Skip to content

RPS Challenge - #2125

Open
joe-mcgarry wants to merge 7 commits into
makersacademy:mainfrom
joe-mcgarry:main
Open

RPS Challenge#2125
joe-mcgarry wants to merge 7 commits into
makersacademy:mainfrom
joe-mcgarry:main

Conversation

@joe-mcgarry

Copy link
Copy Markdown

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

Comment thread Views/result.erb
<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 %>

Copy link
Copy Markdown

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.

Comment thread lib/game.rb
@@ -0,0 +1,29 @@
class Game

Copy link
Copy Markdown

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