Ruby_Dice 1.0.0.pre → 1.0.0.pre.1
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 +4 -4
- data/README.md +1 -1
- data/bin/Ruby_Dice +15 -16
- data/lib/dice.rb +1 -1
- data/lib/player.rb +12 -6
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d0b41e4272ad3e63b64929479bca5d394678b8d8
|
4
|
+
data.tar.gz: bd450c716e3859116be0fa928c521ca299382ff9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e1be61f9c2979458163467c3d16c8c9ee546779ee19859539651bdbb2bb0326a1cdccd482559be94fd3575722efe9ffef59f4b35f26351635d0dcd96ed9b281d
|
7
|
+
data.tar.gz: 0311fda4468da9264582b638bc8ef9c910f4ca1fa13404f7b0c507549ae1d16c4f2179a0f66b1a9c94831a820ba781cf7d6289484333fdabb07a1f48460219a7
|
data/README.md
CHANGED
@@ -5,6 +5,6 @@ This project is a personal project for educational purposes and becoming accusto
|
|
5
5
|
## Badges
|
6
6
|
[](http://inch-ci.org/github/martimatix/Ruby-Dice)
|
7
7
|
[](https://codeclimate.com/github/martimatix/Ruby-Dice)
|
8
|
-
[](https://travis-ci.org/martimatix/Ruby-Dice)
|
9
9
|
[](https://codeclimate.com/github/martimatix/Ruby-Dice)
|
10
10
|
[](http://badge.fury.io/rb/Ruby_Dice)
|
data/bin/Ruby_Dice
CHANGED
@@ -1,25 +1,24 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
BEGIN {
|
2
|
+
BEGIN { # Checks for options
|
3
3
|
if ARGV.include? "-h"
|
4
4
|
puts <<HELP
|
5
5
|
Usage: $ Ruby_Dice [--help]
|
6
|
-
\u00B7 --help -> Displays this help message
|
7
|
-
|
6
|
+
\u00B7 --help -> Displays this help message
|
8
7
|
Gameplay:
|
9
8
|
Abbreviations:
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
9
|
+
\u00B7 1 -> Ones
|
10
|
+
\u00B7 2 -> Twos
|
11
|
+
\u00B7 3 -> Threes
|
12
|
+
\u00B7 4 -> Fours
|
13
|
+
\u00B7 5 -> Fives
|
14
|
+
\u00B7 6 -> Sixes
|
15
|
+
\u00B7 ss -> Small Straight
|
16
|
+
\u00B7 ls -> Large Straight
|
17
|
+
\u00B7 tok -> Three Of A Kind
|
18
|
+
\u00B7 fok -> Four Of A Kind
|
19
|
+
\u00B7 fh -> Full House
|
20
|
+
\u00B7 y -> Yahtzee
|
21
|
+
\u00B7 ? -> Chance
|
23
22
|
HELP
|
24
23
|
exit
|
25
24
|
end
|
data/lib/dice.rb
CHANGED
data/lib/player.rb
CHANGED
@@ -32,19 +32,25 @@ class Player
|
|
32
32
|
def take_turn
|
33
33
|
turn_over = false
|
34
34
|
(1..3).each do |i|
|
35
|
-
display_dice i
|
35
|
+
puts display_dice i
|
36
36
|
turn_over = user_input i
|
37
37
|
break if turn_over
|
38
38
|
end
|
39
39
|
end
|
40
40
|
|
41
|
+
=begin
|
42
|
+
@param i [Fixnum] times rolled
|
43
|
+
@return [String]
|
44
|
+
=end
|
41
45
|
def display_dice(i)
|
42
46
|
sleep 0.5
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
47
|
+
result = String.new
|
48
|
+
result << String.new.center(80, ?-) + ?\n
|
49
|
+
result << "Here are your dice. You have have #{3-i} #{i==2? "roll":"rolls"} remaining.\n\n\n"
|
50
|
+
result << "\tDice\t\tZ\tX\tC\tV\tB" + ?\n
|
51
|
+
result << "\tValues\t\t" + score.dice.values.map{|value| value.to_s}.join(?\t) + ?\n
|
52
|
+
result << String.new.center(80, ?-) + ?\n
|
53
|
+
return result
|
48
54
|
end
|
49
55
|
|
50
56
|
=begin
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: Ruby_Dice
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.pre
|
4
|
+
version: 1.0.0.pre.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Zachary Perlmutter
|
@@ -73,7 +73,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
73
73
|
requirements:
|
74
74
|
- - ">="
|
75
75
|
- !ruby/object:Gem::Version
|
76
|
-
version:
|
76
|
+
version: 1.9.2
|
77
77
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
78
78
|
requirements:
|
79
79
|
- - ">"
|
@@ -82,7 +82,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
82
82
|
requirements:
|
83
83
|
- Terminal
|
84
84
|
rubyforge_project:
|
85
|
-
rubygems_version: 2.4.
|
85
|
+
rubygems_version: 2.4.2
|
86
86
|
signing_key:
|
87
87
|
specification_version: 4
|
88
88
|
summary: A Yahtzee clone written in Ruby that runs in the terminal
|