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

Jennie RPS Challenge solution so far #2131

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

Conversation

Jenniered
Copy link

No description provided.

Copy link

@Hafizalimi7 Hafizalimi7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so far so good, keep up the good work


run! if app_file == $0
end

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

App file is nice and understandable !

<h1 style="font-family: Tahoma" >
Let's play Joe
</h1>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good change of font

@@ -0,0 +1,10 @@
class ComputerChoice
def initialize
@choices = ["Rock", "Paper", "Scissors"]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

put @choice object out of initialiser method

def game_result
if @player_choice == "Rock" && @computer_choice == "Scissors"
return "Win"
elsif @player_choice == "Rock" && @computer_choice == "Paper"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lots of if statements , nice !

return "Win"
elsif @player_choice == "Scissors" && @computer_choice == "Rock"
return "Lose"
else

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

possibly could do one line if statements , i.e
if @player_choice == "Rock" && @computer_choice == "Scissors" || @player_choice == "Paper" && @computer_choice == "Rock"
return "Win"

end



Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very precise code !

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.

None yet

2 participants