Skip to content
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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

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