Ruby Method - Won't Take Second Parameter - Blackjack -


To create a blackjack game that I put the second parameter display_cards method, if everything goes if I method breaks parameter removes am and then I call it, then everything works fine what's going wrong?

  def play game_deck = initialize_deck game_deck = shuffle_deck (game_deck) human_cards = [] computer_cards = [] end def initialize_deck (number_of_decks = 6) deck_values ​​= [ 'A "," 1 " "2" 3 "," 4 "," 5 "," 6 "," 7 "," 8 "," 9 "," 10 "," J "," Q "," K "] suit = [" - small "," -dayands "," -club "," -speeds "] deck = [] number_off_desk.times suits.choice | deck_values.each do | value | deck & lt; value + suit end end end back deck end def display_cards (player_cards, PLAYER_NAME) card_string = "# {PLAYER_NAME} card \ n -----------------" player_cards.each to | charts | card_string + = "\ N | # {Card} "card_string + =" \ n ----------------- "End card_string puts off def shuffle_deck (deck, number_of_shuffles = 6) number_of_shuffles, Times De Deck = Deck Sample (Deck Coat) and Return Deck and DP Pulicard (Game_Dek, PlayerCards) player_gird  

Because of Space, Ruby Beleive "(Test_cards, name)" first argument and learn about the missing second argument YT.

The syntax

  display_cards (test_cards, name) display_cards test_cards, name  
will work

Comments

Popular posts from this blog

winforms - C# Form - Property Change -

javascript - amcharts makechart not working -

java - Algorithm negotiation fail SSH in Jenkins -