This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @(#) | |
* | |
* This program will generate your Phd thesis, might take a while(like several lifetimes of the universe). | |
* Simply change the thesisLength to number of characters you would like your Phd to contain. | |
* | |
* @Chester Grant | |
* @version 1.00 2010/8/10 | |
*/ | |
import java.io.*; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if(you.understand(this)){ | |
you.suggestion("Get a Girlfriend"); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
$arr = keypadsArr("h,e,s,s,c"); | |
echo "Created by: Chester Grant \n"; | |
echo "Purpose: Unscrambles letters(see line 199)\n"; | |
echo "Date: 9th/04/2011\n"; | |
combination("",0,$arr); | |
function combination($output,$pos,$dataSet){ | |
if($pos == count($dataSet)){ | |
echo $output."\n"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- "Created by: Chester Grant |Got code from:http://www.haskell.org/pipermail/haskell-cafe/2002-June/003122.html"; | |
-- "Purpose: Unscrambles letters(see line 199)\n"; | |
-- "Date: 9th/04/2011\n"; | |
selections [] = [] | |
selections (x:xs) = (x,xs) : [ (y,x:ys) | (y,ys) <- selections xs ] | |
permutations :: [a] -> [[a]] | |
permutations [] = [[]] | |
permutations xs = [ y : zs | (y,ys) <- selections xs, zs <- permutations ys] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Got code from: http://www.haskell.org/haskellwiki/Why_Haskell_matters | |
template <typename T> | |
void qsort (T *result, T *list, int n) | |
{ | |
if (n == 0) return; | |
T *smallerList, *largerList; | |
smallerList = new T[n]; | |
largerList = new T[n]; | |
T pivot = list[0]; | |
int numSmaller=0, numLarger=0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--Got code from: http://www.haskell.org/haskellwiki/Why_Haskell_matters | |
qsort [] = [] | |
qsort (x:xs) = qsort less ++ [x] ++ qsort more | |
where less = filter (<x) xs | |
more = filter (>=x) xs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class TenCount { | |
public static void main(String[] args) { | |
for(int i=1; i<=10; i++){ | |
System.out.println(i); | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class NameTimesHundred { | |
public static void main(String[] args) { | |
for(int i=0; i<100; i++){ | |
System.out.println("Chester"); | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.*; | |
public class ReadTwoNumbers { | |
//When reading in digit you need to account for invalid inputs | |
public static int readNum(String promptMsg, boolean hasPrompt){ | |
boolean isDig = true; //Checks if the value just read in is an integer | |
int output = -1; //Stores the return value of the read in number | |
do{ | |
isDig = true; | |
Scanner input= new Scanner (System.in); //Use to read in the data |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class InterweavingNames { | |
public static void main(String[] args) { | |
String firstname = "Chester"; | |
String lastname = "Grant"; | |
for(int i =1; i<=100; i++){ | |
System.out.print(firstname); | |
if((i % 20) == 0){ | |
System.out.print(" "+lastname); |
OlderNewer