Jeremy Woertink <its_conebred_foo / hotmail.com> wrote:

> game = Game.new
> 
> game.get_player_command
> 
> while true
>   puts 'Your hand is: '
>     @player.player_hand
>   puts 'The dealer hand is: '
>     @dealer.dealer_hand
>   puts "Do you want to 'hit' or 'stay'?"
>   @game.get_player_command
>   if @player.bust?
>     puts 'You lose...'
>     @game.game_over
>   else
>     @dealer.dealer_hit
>     if @dealer.bust?
>       puts 'You Win!'
>       @game.game_over
>     end
>   end
> end
> 
> 
> The problem I am running into is I get the error " uninitialized 
> constant Game (Name Error). How do I tell ruby to make a new game class
> to start the game.
> the whole code is here http://rafb.net/paste/results/3kQ9pr90.html

Order is kinda crucial. Declaration of class Game must precede its use.
m.

-- 
matt neuburg, phd = matt / tidbits.com, http://www.tidbits.com/matt/
Tiger - http://www.takecontrolbooks.com/tiger-customizing.html
AppleScript - http://www.amazon.com/gp/product/0596102119
Read TidBITS! It's free and smart. http://www.tidbits.com