Skip to content

Commit

Permalink
Add ruby script to allow running game, where arguments are player names
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael de Silva committed Oct 6, 2015
1 parent 4203013 commit fb1ab2a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions koans/greed/lib/greed.rb
Expand Up @@ -113,7 +113,7 @@ def play
# they have remaining dice); if not, break.
if dice > 0 && !zero_point_roll?(result[:roll], result[:score])
print "You have #{dice} dice remaining, do you wish to roll (y/n)? "
response = gets.chomp.downcase.to_sym
response = STDIN.gets.chomp.downcase.to_sym

break if response == :n
end
Expand Down Expand Up @@ -154,7 +154,7 @@ def take_player_input
print_commands

print "Enter command: "
gets.chomp.to_sym
STDIN.gets.chomp.to_sym
end

def take_action(action)
Expand Down
4 changes: 4 additions & 0 deletions koans/greed/play_greed.rb
@@ -0,0 +1,4 @@
#!/usr/bin/env ruby
require File.expand_path(File.dirname(__FILE__) + "/lib/greed")

Greed::Game.start_game(*ARGV)

0 comments on commit fb1ab2a

Please sign in to comment.