rockpaperscissorsbattle 0.1.6 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5c9659d13b0952f0792c0d5eebba201c0ec50965
4
- data.tar.gz: 61ba9e4e49217c2c1096694c174a1ce83b01ea49
3
+ metadata.gz: e68e2683c13bc83ed9d8b0c01d6e77c7b03f8c0f
4
+ data.tar.gz: 03a1a0f03a16718a87c5a6b8e71f27c69a83d63b
5
5
  SHA512:
6
- metadata.gz: 12befad7c7b31306a7cfbd3c93f593b095bce7456fcff7df9ee8c97f2a1e8accc956eb0297155dc0a9bf1789c9436bc809640a0b10d6e8d7859fc85998cc452d
7
- data.tar.gz: 7269be3f7a78eec3f012bda9a05bfc23159ea69491a8a8b3949d40dbdb06e39c0c4c9d70d1f8b036457e2f9e4544ddc41c5172f33ef62feb5d028b78cb1e2331
6
+ metadata.gz: af99145f64427f8c45586a5330c7a5a9a8c6a03fdcba77185959fca28cac584e9a485f0c3f63c7f5abed1d8a56cceb19b8e93dc7f9bfd3d7e7f98c0fcaeeb48f
7
+ data.tar.gz: a32449190bfa86f6f33476d3d082d7257acd24b6ddaefc7694c390f9259c02c697cf1bff6c061595b744208c8c837eafe97fb220e1dd6d423b2f76283478d2ad
@@ -6,10 +6,16 @@ module Rockpaperscissorsbattle
6
6
  @player2 = args[:player2] || Computer.new
7
7
  end
8
8
 
9
- def play
9
+ def welcome
10
10
  puts "Welcome to Rock Paper Scissors"
11
+ end
12
+
13
+ def play
11
14
  puts "Get ready to Battle!"
15
+
16
+ print "Player 1:"
12
17
  pick1 = @player1.pick(@options)
18
+ print "Player 2:"
13
19
  pick2 = @player2.pick(@options)
14
20
  compare(pick1, pick2)
15
21
  end
@@ -5,7 +5,7 @@ module Rockpaperscissorsbattle
5
5
  choice = nil
6
6
  until options.include?(choice)
7
7
  puts %Q;Enter "r", "p" or "s";
8
- choice = gets.strip.to_sym
8
+ choice = STDIN.noecho(&:gets).strip.to_sym
9
9
  end
10
10
  choice
11
11
  end
@@ -23,13 +23,19 @@ module Rockpaperscissorsbattle
23
23
 
24
24
  def track_winners(winner)
25
25
  @score[winner] += 1
26
- p @score
26
+ puts "Player 1 score: #{@score[1]}"
27
+ puts "Player 2 score: #{@score[2]}"
28
+ puts "Ties: #{@score[0]}"
27
29
  end
28
30
 
29
31
  def reset
30
32
  puts "Would you like to play again? (Y/N)"
31
33
  choice = gets.strip.downcase
32
- start if choice == "y"
34
+ if choice == "y"
35
+ start
36
+ else
37
+ puts "Thanks for playing!"
38
+ end
33
39
  end
34
40
 
35
41
 
@@ -1,3 +1,3 @@
1
1
  module Rockpaperscissorsbattle
2
- VERSION = "0.1.6"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rockpaperscissorsbattle
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sampson Crowley