RLCoreKickstart 0.0.7 → 0.0.8

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: 2f0066824a5383838aa8a7b724d53551f06b3e09
4
- data.tar.gz: df702555c89c9811a70b3daf70e63a0cf2a7fc46
3
+ metadata.gz: a11406eb164c08a9351d3bb174bc9ba63b83eaae
4
+ data.tar.gz: dd00704c3987b6fd79349780d19db8e202424b82
5
5
  SHA512:
6
- metadata.gz: 9e7532a0b8f480cf486c26b07c8fae0ca42bac9b1edb2da11ac9dc109103e73c44bfe2aabe75e6fa06362f43a11f3a780b14f1044165d73da7a77c546de8c77f
7
- data.tar.gz: ecaf8e2489ec2e929230d746e8ce08b5152afbaf145a11ba99698f32c303564081f134079a21e09ac2a8a666bd65854b91e832a7b43ba36983a10f94bcd5fc3f
6
+ metadata.gz: 02653b471522f9b9f659c008eee626d44e3aa47e1621d33136564de26b05c3c669c9d148e5adfd8bd4c9bd54c2fec114c898c50f7a0d3dd567651c3e49efc79a
7
+ data.tar.gz: 3159fafcdfa4968ce34db7c4faaadcf3d26419dd5be72ffd4aca88c34dac475368afc4209732c6e303d281d9c81c6805928c46962f6a51ed81c685495f79c8d0
data/bin/testgameboard ADDED
@@ -0,0 +1,34 @@
1
+ #! /usr/bin/env ruby
2
+ require './5_week/3e_gameboard'
3
+
4
+ # track how many guesses the user makes
5
+ no_of_guesses = 0
6
+
7
+ # instantiate a GameBoard object
8
+ gb = GameBoard.new
9
+
10
+ # make a random number for the first cell,
11
+ # and use it to make the cell locations array
12
+ random_no = rand(5)
13
+ # make an array for the location of the 3
14
+ # consecutive ints out of a possible 7
15
+ locations = [random_no, random_no+1, random_no+2]
16
+
17
+ # invoke the setter method of the GameBoard
18
+ gb.set_locations_cells(locations)
19
+
20
+ # variable to track if the game is alive
21
+ is_alive = true
22
+
23
+ while is_alive
24
+ puts 'Enter a number: '
25
+ STDOUT.flush
26
+ user_guess = gets.chomp
27
+ # invoke the check_yourself method on the GameBoard object
28
+ result = gb.check_yourself(user_guess)
29
+ no_of_guesses += 1
30
+ if (result == 'kill')
31
+ is_alive = false
32
+ puts "You took #{no_of_guesses} guesses"
33
+ end
34
+ end
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "RLCoreKickstart"
5
- spec.version = '0.0.7'
5
+ spec.version = '0.0.8'
6
6
  spec.required_ruby_version = '>= 1.9'
7
7
  spec.authors = ["Victor Goff"]
8
8
  spec.email = ["keeperotphones@gmail.com"]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: RLCoreKickstart
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Victor Goff
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-01 00:00:00.000000000 Z
11
+ date: 2014-12-14 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Prepares a set of folders for the RubyLearning Core Ruby Course, install
14
14
  by issuing command "gem install RLCoreKickstart"
@@ -16,6 +16,7 @@ email:
16
16
  - keeperotphones@gmail.com
17
17
  executables:
18
18
  - skeleton_rl_core
19
+ - testgameboard
19
20
  extensions: []
20
21
  extra_rdoc_files: []
21
22
  files:
@@ -24,6 +25,7 @@ files:
24
25
  - README.md
25
26
  - Rakefile
26
27
  - bin/skeleton_rl_core
28
+ - bin/testgameboard
27
29
  - contributors.txt
28
30
  - lib/assets/file_listing.txt
29
31
  - lib/rlcorekickstart.rb
@@ -51,7 +53,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
51
53
  version: '0'
52
54
  requirements: []
53
55
  rubyforge_project:
54
- rubygems_version: 2.2.2
56
+ rubygems_version: 2.4.4
55
57
  signing_key:
56
58
  specification_version: 4
57
59
  summary: Provide some basic tools for the Ruby course at http://rubylearning.org