Ruby_Dice 1.0.0.pre → 1.0.0.pre.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (6) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/bin/Ruby_Dice +15 -16
  4. data/lib/dice.rb +1 -1
  5. data/lib/player.rb +12 -6
  6. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 94e563c4bbfab5d2e0efe9e3b286b3b48f8bb45f
4
- data.tar.gz: 4796d59ae2e73bf1b47bf7bf37adf250561c92c9
3
+ metadata.gz: d0b41e4272ad3e63b64929479bca5d394678b8d8
4
+ data.tar.gz: bd450c716e3859116be0fa928c521ca299382ff9
5
5
  SHA512:
6
- metadata.gz: ef488d12af8d9e32624f69ec6e0b089ee0ea226f2057fe5656c83d346519ab8214d7df2c3ebc0cb85f124ab2daa4183a8b5d42d11362393ae664c031a91db5d5
7
- data.tar.gz: 54e572b7af23e772b8fb9e8029c11c8002ae75b015d8aa342142f7a7d6bc8de8b5a2a2b6819c4cf0fb40cbd3ef60e8ceb341522aeca856554d1d88160ee3fae6
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
  [![Inline docs](http://inch-ci.org/github/martimatix/Ruby-Dice.svg?branch=master)](http://inch-ci.org/github/martimatix/Ruby-Dice)
7
7
  [![Code Climate](https://codeclimate.com/github/martimatix/Ruby-Dice/badges/gpa.svg)](https://codeclimate.com/github/martimatix/Ruby-Dice)
8
- [![Build Status](https://travis-ci.org/martimatix/Ruby-Dice.svg)](https://travis-ci.org/martimatix/Ruby-Dice)
8
+ [![Build Status](https://travis-ci.org/martimatix/Ruby_Dice.svg)](https://travis-ci.org/martimatix/Ruby-Dice)
9
9
  [![Test Coverage](https://codeclimate.com/github/martimatix/Ruby-Dice/badges/coverage.svg)](https://codeclimate.com/github/martimatix/Ruby-Dice)
10
10
  [![Gem Version](https://badge.fury.io/rb/Ruby_Dice.svg)](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
- \u00B7 1 -> Ones
11
- \u00B7 2 -> Twos
12
- \u00B7 3 -> Threes
13
- \u00B7 4 -> Fours
14
- \u00B7 5 -> Fives
15
- \u00B7 6 -> Sixes
16
- \u00B7 ss -> Small Straight
17
- \u00B7 ls -> Large Straight
18
- \u00B7 tok -> Three Of A Kind
19
- \u00B7 fok -> Four Of A Kind
20
- \u00B7 fh -> Full House
21
- \u00B7 y -> Yahtzee
22
- \u00B7 ? -> chance
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
@@ -27,7 +27,7 @@ class Dice # Class for working with the 5 dice at the same time
27
27
  @return [Dice]
28
28
  =end
29
29
  def roll_all
30
- new
30
+ initialize
31
31
  end
32
32
 
33
33
  # @!endgroup
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
- puts String.new.center(80, ?-)
44
- puts "Here are your dice. You have have #{3-i} #{i==2? "roll":"rolls"} remaining.\n\n"
45
- puts "\tDice\t\tZ\tX\tC\tV\tB"
46
- puts "\tValues\t\t" + score.dice.values.map{|value| value.to_s}.join(?\t)
47
- puts String.new.center(80, ?-)
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: '0'
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.5
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