Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Game
- attr_reader :secret
- def initialize
- @secret = Secret.new
- end
- def console_play
- bulls = -1
- while bulls != 4
- bulls = 0
- cows = 0
- print "Your guess please: "
- guess = gets.chomp.split("").collect { |d| d.to_i }
- (bulls,cows) = secret.score(guess)
- puts "You have #{cows} cows and #{bulls} bulls"
- end
- end
- end
Add Comment
Please, Sign In to add comment