Skip to content

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.

2 participants