-
Notifications
You must be signed in to change notification settings - Fork 2k
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
base: main
Are you sure you want to change the base?
Conversation
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.
so far so good, keep up the good work
|
||
run! if app_file == $0 | ||
end | ||
|
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.
App file is nice and understandable !
<h1 style="font-family: Tahoma" > | ||
Let's play Joe | ||
</h1> | ||
|
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.
good change of font
@@ -0,0 +1,10 @@ | |||
class ComputerChoice | |||
def initialize | |||
@choices = ["Rock", "Paper", "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.
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" |
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.
Lots of if statements , nice !
return "Win" | ||
elsif @player_choice == "Scissors" && @computer_choice == "Rock" | ||
return "Lose" | ||
else |
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.
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 | ||
|
||
|
||
|
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.
very precise code !
"updating README from remote"
No description provided.