lib/games/mastermind/io_helpers.rb in games_bfox-0.4.0 vs lib/games/mastermind/io_helpers.rb in games_bfox-0.6.0
- old
+ new
@@ -1,6 +1,6 @@
-require_relative '../shared/io_helpers'
+require File.join('games', 'shared', 'io_helpers')
require 'paint'
module MM
class IOHelpers < Shared::IOHelpers
def custom_final_message(game)
@@ -28,12 +28,12 @@
def computer_or_human_guesser_inquiry
user_choice = get_user_input("Please enter " + Paint["\"1\" ", :blue, :bold] + "if you would like to be the code-guesser. Enter " + Paint["\"2\" ", :blue, :bold] + "if you would like to set the code and have the computer guess.", "Invalid entry. Please enter either 1(computer picks code) or 2 (you pick code)") do |input|
input == 1 || input == 2
end
if user_choice == 1
- return :human
+ :human
elsif user_choice == 2
- return :computer
+ :computer
end
end
def get_secret_code_from_user
user_choice = get_user_input("Please enter a secret code consisting of four numbers that each correspond to a color. Do not separate with punctuation. The computer will try to guess this code.", "Please re-enter a secret code, using only 4 numbers, 1 through 6.") do |input|
\ No newline at end of file