Created
February 17, 2016 20:17
-
-
Save neight-allen/00a9525b27438aeaf202 to your computer and use it in GitHub Desktop.
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
class MastermindTest | |
def test_if_I_input_i_do_I_get_game_instructions | |
mastermind = Mastermind.new | |
output = mastermind.process_input("i") | |
assert_equal "instructions", output | |
output = mastermind.process_input("p") | |
assert_equal "new game string", output | |
output = mastermind.process_input("RGBY") | |
assert_equal "wrong code", output | |
end | |
end |
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
require_relative 'mastermind' | |
class RePL | |
def initialize | |
@mastermind = Mastermind.new | |
io_loop | |
end | |
def io_loop | |
loop do | |
output = @mastermind.process_input(gets.chomp) | |
break if output.nil? | |
puts output | |
end | |
return nil | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment