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 +4 -4
- data/bin/testgameboard +34 -0
- data/rlcorecoursekickstarter.gemspec +1 -1
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a11406eb164c08a9351d3bb174bc9ba63b83eaae
|
4
|
+
data.tar.gz: dd00704c3987b6fd79349780d19db8e202424b82
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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.
|
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-
|
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.
|
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
|