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

RPS Challenge #2125

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

RPS Challenge #2125

wants to merge 7 commits into from

Conversation

joe-mcgarry
Copy link

My attempt at the RPS challenge, with a very simple implementation of multiplayer functionality

<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 %>

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

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!

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