Skip to content

Instantly share code, notes, and snippets.

@neight-allen
Created February 17, 2016 20:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save neight-allen/00a9525b27438aeaf202 to your computer and use it in GitHub Desktop.
Save neight-allen/00a9525b27438aeaf202 to your computer and use it in GitHub Desktop.
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
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