This file contains 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
package com.kata.junit; | |
import java.util.*; | |
public class PrimeFactors { | |
public static List<Integer> generate(int number) { | |
return new ArrayList<Integer>(); | |
} | |
} |
This file contains 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
package com.kata.junit; | |
import java.util.*; | |
public class PrimeFactors { | |
public static List<Integer> generate(int number) { | |
ArrayList<Integer> primes = new ArrayList<Integer>(); | |
if(number == 1) return primes; | |
primes.add(number); | |
return primes; | |
} |
This file contains 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
package com.kata.junit; | |
import java.util.*; | |
public class PrimeFactors{ | |
public static List<Integer> generate(int number) { | |
ArrayList<Integer> primes = new ArrayList<Integer>(); | |
if(number == 1) return primes; | |
if(number % 2 == 0) { | |
primes.add(2); | |
number = number/2; |
This file contains 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
package com.kata.junit; | |
import java.util.*; | |
public class PrimeFactors { | |
public static List<Integer> generate(int number) { | |
ArrayList<Integer> primes = new ArrayList<Integer>(); | |
if(number == 1) return primes; | |
int i = 1; | |
while(i <= number) { |
This file contains 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
package com.kata.junit; | |
import org.junit.Before; | |
import org.junit.Test; | |
import java.util.ArrayList; | |
import java.util.List; | |
import static org.junit.Assert.assertEquals; |
This file contains 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
@Test | |
public void testDecodesNoMatches() { | |
Board board = new Board(); | |
List<Peg> userGuess = Arrays.asList(Peg.YELLOW, Peg.BLUE, Peg.RED, Peg.GREEN); | |
List<Peg> actualCode = Arrays.asList(Peg.PURPLE, Peg.PINK, Peg.ORANGE, Peg.BROWN); | |
Hint hint = board.decode(userGuess, actualCode); | |
assertEquals(new Hint(0,0), hint); | |
} |
This file contains 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
package com.mastermind; | |
import java.io.BufferedReader; | |
import java.io.IOException; | |
import java.io.InputStreamReader; | |
import java.util.ArrayList; | |
import java.util.List; | |
public class CommandLineInterface { |
This file contains 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 MyPrinter implements MyPrinterInterface(){ | |
@Override | |
public void printToScreen(String toPrint){ | |
System.out.println(toPrint); | |
} | |
} | |
public class MyPrinterMock implements MyPrinterInterface(){ |
This file contains 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
package com.mastermind; | |
import java.io.BufferedReader; | |
import java.io.IOException; | |
import java.io.InputStreamReader; | |
import java.io.PrintStream; | |
import java.util.ArrayList; | |
import java.util.List; | |
public class CommandLineInterface { |
This file contains 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
source "https://rubygems.org" | |
gem 'sinatra' |