x_and_os 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0d992babe9dd2b0f2ccde30604920cf3e8cc0f72
4
- data.tar.gz: fbe6d30630b944476bc9a32e309970ec0745958f
3
+ metadata.gz: 26abf99b399b44f43e52de5048bf505d0ba28db0
4
+ data.tar.gz: 5f50b16285f9519b984be7590adbf5ac829c5001
5
5
  SHA512:
6
- metadata.gz: 8ad4a9fb34a1f47d4b610b2a7fee71524cea7c6cad5028c94f713b5151d59f0ae441212c1047f1306101c3ad0c8ae9e436069e9991f9fa00f63d1b406424468f
7
- data.tar.gz: 2594b09d691adcb49bd15830ef2309441f63aa1e361e60315e4f448ac86fe2080dc1df6912a612af04c6634841595253e4644be1dec79129d33bc82d0bf01945
6
+ metadata.gz: f8ab4f63dcd2fbdfd5f8388a2f9aafd6897a6773c6d23e4fa13fceb14011c613aba05a10af180f95eaa233656dcd87ea57f25d6170ab6cc2121f36664c042159
7
+ data.tar.gz: 2a47b86dc429bfeaf25ef08a3c9caabb358d6a39e32d8e3e6c23d7dc7385f0ca417ce5a0b29cf49cab4d5d4f1d6e4799e11a987f93828c09363f6f501842602a
@@ -10,7 +10,7 @@ module TicTacToe
10
10
  def start_app
11
11
  UI.output
12
12
  UI.output 'Welcome to TicTacToe'
13
- UI.output 'Quick Game?'
13
+ UI.output 'Quick Game? (player vs computer : 3x3 board'
14
14
  settings unless UI.receive =~ /^y/i
15
15
  loop do
16
16
  play
@@ -21,13 +21,11 @@ module TicTacToe
21
21
  UI.output 'Change settings?'
22
22
  settings if UI.receive =~ /^y/i
23
23
  end
24
-
25
24
  UI.output
26
25
  UI.output 'Thank you for playing.'
27
26
  end
28
27
 
29
28
  private
30
-
31
29
  def settings
32
30
  choose_player
33
31
  choose_board_size
@@ -41,7 +39,6 @@ module TicTacToe
41
39
  UI.output
42
40
  UI.output 'Player 1'
43
41
  @player_one = player_type(UI.receive)
44
- UI.output
45
42
  UI.output 'Player 2'
46
43
  @player_two = player_type(UI.receive)
47
44
  UI.output
@@ -53,7 +50,6 @@ module TicTacToe
53
50
  UI.output ' 3: 3x3'
54
51
  UI.output ' 4: 4x4'
55
52
  UI.output ' N: NxN'
56
- UI.output
57
53
  size = UI.receive
58
54
  @board_size = (size.to_i >= 1) ? size : 3
59
55
  UI.output
@@ -75,12 +71,14 @@ module TicTacToe
75
71
  @board_size ||= 3
76
72
  end
77
73
 
78
-
79
74
  def player_type(player)
80
75
  if player =~ /^p/i
81
76
  HumanPlayer
82
77
  elsif player =~ /^c/i
83
78
  ComputerPlayer
79
+ else
80
+ UI.output ' Invalid player type, please try again.'
81
+ choose_player
84
82
  end
85
83
  end
86
84
 
@@ -1,3 +1,3 @@
1
1
  module XAndOs
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: x_and_os
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonny