started with the TicTacToe_MinMax Project. Finished the rendering of the game.
TODO: Make a playable version and add MinMax
This commit is contained in:
35
CodingChallanges/src/tests/FiscalCodeTest.java
Normal file
35
CodingChallanges/src/tests/FiscalCodeTest.java
Normal file
@@ -0,0 +1,35 @@
|
||||
package tests;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import org.junit.Test;
|
||||
import strings.FiscalCode;
|
||||
|
||||
/**
|
||||
* @author edwardclark
|
||||
**/
|
||||
|
||||
public class FiscalCodeTest {
|
||||
@Test
|
||||
public void test1() throws Exception {
|
||||
assertEquals("CHEBND61T01", FiscalCode.fiscalCode("Brendan", "Eich", "M", "1/12/1961"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test2() throws Exception {
|
||||
assertEquals("YUXHLN50T41", FiscalCode.fiscalCode("Helen", "Yu", "F", "1/12/1950"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test3() throws Exception {
|
||||
assertEquals("CPNLAX99A17", FiscalCode.fiscalCode("Al", "Capone", "M", "17/1/1899"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test4() throws Exception {
|
||||
assertEquals("MSOMKY28A16", FiscalCode.fiscalCode("Mickey", "Mouse", "M", "16/1/1928"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test5() throws Exception {
|
||||
assertEquals("CRUMRA67S47", FiscalCode.fiscalCode("Marie", "Curie", "F", "7/11/1867"));
|
||||
}
|
||||
}
|
||||
34
CodingChallanges/src/tests/PigLatinTranslationTest.java
Normal file
34
CodingChallanges/src/tests/PigLatinTranslationTest.java
Normal file
@@ -0,0 +1,34 @@
|
||||
package tests;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import translation_encryption.PigLatinTranslation;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
public class PigLatinTranslationTest {
|
||||
@Test
|
||||
public void test1() {
|
||||
Assert.assertEquals("Atscay areway reatgay etspay.", PigLatinTranslation.pigLatin("Cats are great pets."));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test2() {
|
||||
assertEquals("Omtay otgay away mallsay iecepay ofway iepay.", PigLatinTranslation.pigLatin("Tom got a small piece of pie."));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test3() {
|
||||
assertEquals("Ehay oldtay usway away eryvay excitingway aletay.", PigLatinTranslation.pigLatin("He told us a very exciting tale."));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test4() {
|
||||
assertEquals("Away iamondday isway otnay enoughway.", PigLatinTranslation.pigLatin("A diamond is not enough."));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test5() {
|
||||
assertEquals("Urryhay!", PigLatinTranslation.pigLatin("Hurry!"));
|
||||
}
|
||||
}
|
||||
53
CodingChallanges/src/tests/ValidateCreditCardTest.java
Normal file
53
CodingChallanges/src/tests/ValidateCreditCardTest.java
Normal file
@@ -0,0 +1,53 @@
|
||||
package tests;
|
||||
|
||||
import org.junit.Test;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import numbers.ValidateCreditCard;
|
||||
|
||||
public class ValidateCreditCardTest {
|
||||
@Test
|
||||
public void test1() {
|
||||
assertEquals(false, ValidateCreditCard.validateCard(79927398714L));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test2() {
|
||||
System.out.println("Passes Luhn test, but too short.");
|
||||
assertEquals(false, ValidateCreditCard.validateCard(79927398713L));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test3() {
|
||||
assertEquals(true, ValidateCreditCard.validateCard(709092739800713L));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test4() {
|
||||
assertEquals(false, ValidateCreditCard.validateCard(1234567890123456L));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test5() {
|
||||
assertEquals(true, ValidateCreditCard.validateCard(12345678901237L));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test6() {
|
||||
assertEquals(true, ValidateCreditCard.validateCard(5496683867445267L));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test7() {
|
||||
assertEquals(false, ValidateCreditCard.validateCard(4508793361140566L));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test8() {
|
||||
assertEquals(true, ValidateCreditCard.validateCard(376785877526048L));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test9() {
|
||||
assertEquals(false, ValidateCreditCard.validateCard(36717601781975L));
|
||||
}
|
||||
}
|
||||
51
CodingChallanges/src/tests/WordChainTest.java
Normal file
51
CodingChallanges/src/tests/WordChainTest.java
Normal file
@@ -0,0 +1,51 @@
|
||||
package tests;
|
||||
import org.junit.Test;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import strings.WordChain;
|
||||
|
||||
public class WordChainTest {
|
||||
@Test
|
||||
public void test1() {
|
||||
assertEquals(true, WordChain.isWordChain(new String[]{"row", "crow", "crown", "brown", "brawn"}));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test2() {
|
||||
assertEquals(true, WordChain.isWordChain(new String[]{"flew", "flaw", "flan", "flat", "fat", "rat", "rot", "tot"}));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test3() {
|
||||
assertEquals(false, WordChain.isWordChain(new String[]{"meek", "meet", "meat", "teal"}));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test4() {
|
||||
assertEquals(false, WordChain.isWordChain(new String[]{"run", "runny", "bunny"}));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test5() {
|
||||
assertEquals(true, WordChain.isWordChain(new String[]{"fun", "fund", "find", "bind", "wind", "wild", "wile", "wiles"}));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test6() {
|
||||
assertEquals(true, WordChain.isWordChain(new String[]{"nut", "but", "bot", "boot", "loot", "look", "book", "brook"}));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test7() {
|
||||
assertEquals(true, WordChain.isWordChain(new String[]{"some", "tome", "tame", "lame", "flame", "flamer", "blamer", "blamers"}));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test8() {
|
||||
assertEquals(false, WordChain.isWordChain(new String[]{"a", "at", "hat", "that", "what", "flat"}));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test9() {
|
||||
assertEquals(false, WordChain.isWordChain(new String[]{"link", "blink", "wink", "sink"}));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user