我正在學習一個learn.co實驗室二十一點cli線是https://learn.co/tracks/web-development-fundamentals/intro-to-ruby/looping/blackjack-cli?batch_id=166&track_id=10415然而,需要通過的15個例子,我不斷收到一個錯誤6我主要有麻煩initial_round方法和命中?方法。在我的二十一點cli ruby中的錯誤消息
def deal_card
rand(11) + 1
end
def display_card_total(card)
puts "Your cards add up to #{card}"
end
def prompt_user
puts "Type 'h' to hit or 's' to stay"
end
def get_user_input
gets.chomp
end
def end_game(card_total)
puts "Sorry, you hit #{card_total}. Thanks for playing!"
end
def initial_round
deal_card
deal_card
return deal_card + deal_card
puts display_card_total
end
def hit?
prompt_user
end
def invalid_command
puts "Please enter a valid command"
end
希望這是足夠的信息
這讓我有如此多的感覺,我真的覺得好像有時我想我需要努力閱讀錯誤消息的能力更多 – Daquon
我仍然遇到初始問題 – Daquon