Skip to content

Jennie RPS Challenge solution so far - #2131

Open
Jenniered wants to merge 11 commits into
makersacademy:mainfrom
Jenniered:main
Open

Jennie RPS Challenge solution so far#2131
Jenniered wants to merge 11 commits into
makersacademy:mainfrom
Jenniered:main

Conversation

@Jenniered

Copy link
Copy Markdown

No description provided.

@Hafizalimi7 Hafizalimi7 left a comment

Copy link
Copy Markdown

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

Comment thread app.rb

run! if app_file == $0
end

Copy link
Copy Markdown

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>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

good change of font

Comment thread lib/computer_choice.rb
@@ -0,0 +1,10 @@
class ComputerChoice
def initialize
@choices = ["Rock", "Paper", "Scissors"]

Copy link
Copy Markdown

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

Comment thread lib/game.rb
def game_result
if @player_choice == "Rock" && @computer_choice == "Scissors"
return "Win"
elsif @player_choice == "Rock" && @computer_choice == "Paper"

Copy link
Copy Markdown

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 !

Comment thread lib/game.rb
return "Win"
elsif @player_choice == "Scissors" && @computer_choice == "Rock"
return "Lose"
else

Copy link
Copy Markdown

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"

Comment thread spec/units/game_spec.rb
end



Copy link
Copy Markdown

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.

2 participants