Skip to content

Nagore rock/papers/scissors#236

Open
nagorevalero wants to merge 2 commits intomakersacademy:mainfrom
nagorevalero:main
Open

Nagore rock/papers/scissors#236
nagorevalero wants to merge 2 commits intomakersacademy:mainfrom
nagorevalero:main

Conversation

@nagorevalero
Copy link

Individual challenge

app.rb Outdated
end

run! if app_file == $0

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"

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"

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants