-
Notifications
You must be signed in to change notification settings - Fork 250
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nagore rock/papers/scissors #236
base: main
Are you sure you want to change the base?
Conversation
app.rb
Outdated
end | ||
|
||
run! if app_file == $0 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A lot of whitespace, maybe delete it to tidy it up
def play | ||
if @player_choice == @computer_move | ||
return "It's a draw" | ||
elsif @player_choice == "rock" && @computer_move == "scissors" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation?
return "Player wins as the computer chose scissors" | ||
elsif @player_choice == "scissors" && @computer_move == "rock" | ||
return "Computer wins as the computer chose rock" | ||
elsif @player_choice == "paper" && @computer_move == "rock" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can it be refactored into a neater way instead of using many elsifs?
Individual challenge