Class: Board

Inherits:
Object
  • Object
show all
Defined in:
lib/rps_telwell/board.rb

Overview

Controls the “board” for the game In RPS there isn’t much board so this will control the output.

Instance Method Summary collapse

Instance Method Details

#clearObject

Clear board



6
7
8
# File 'lib/rps_telwell/board.rb', line 6

def clear
	system "clear"
end

#render(player_1_wins = 0, player_2_wins = 0) ⇒ Object

Render



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/rps_telwell/board.rb', line 11

def render(player_1_wins= 0,player_2_wins=0)
	output = "
ROCK PAPER SCISSORS
-------------------
You know how to play!
Enter: 
1 for rock, 
2 for paper, or 
3 for scissors. Good luck!

SCORE
--------------------
Player 1: #{player_1_wins}
Player 2: #{player_2_wins}\n"
	clear
	print output
end