-
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
RPS Challenge #2125
base: main
Are you sure you want to change the base?
RPS Challenge #2125
Conversation
<h3><%= @game.player_1.name %> chose <%= @game.get_player_1_choice %></h3> | ||
<h3><%= @game.player_2.name %> chose <%= @game.get_player_2_choice %></h3> | ||
|
||
<% if @game.get_player_1_choice == @game.get_player_2_choice %> |
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.
This logic in the view could be moved to a class. So, the view doesn't have to do too much work.
@@ -0,0 +1,29 @@ | |||
class Game |
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.
I really like this! It makes your code easy to follow and keeps the app.rb concise!
My attempt at the RPS challenge, with a very simple implementation of multiplayer functionality