gobig_gohome 0.1.0

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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: f51dff33ae8732139e7ab5c74afc51dbafabd403
4
+ data.tar.gz: c80150b8881559422bdbc163d32bd55a8ee3b8a7
5
+ SHA512:
6
+ metadata.gz: dcc36cca7ca02f0454b67c8abe57dd332a3b55c8817b76279de192a29c31d43167c2f8d5a66f6150820d48fea9e3bb32afef1e0934874d001719d5fabcdc1321
7
+ data.tar.gz: adc64e558e8cc2dacfdb93ba179f89dd9a6d769643e70b83a558dec999187a89a7f001d1e7a968bd0ed3e37ea7ae46e0f9c1aba0e85328a6ed00c6832c92bbcb
@@ -0,0 +1,8 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ source "https://rubygems.org"
2
+
3
+ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
+
5
+ # Specify your gem's dependencies in gobig_gohome.gemspec
6
+ gemspec
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2018 henrytkeenan
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,39 @@
1
+ # GobigGohome
2
+
3
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/gobig_gohome`. To experiment with that code, run `bin/console` for an interactive prompt.
4
+
5
+ TODO: Delete this and the text above, and describe your gem
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'gobig_gohome'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install gobig_gohome
22
+
23
+ ## Usage
24
+
25
+ TODO: Write usage instructions here
26
+
27
+ ## Development
28
+
29
+ After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
+
31
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
+
33
+ ## Contributing
34
+
35
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/gobig_gohome.
36
+
37
+ ## License
38
+
39
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+ task :default => :spec
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "gobig_gohome"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start(__FILE__)
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,34 @@
1
+
2
+ lib = File.expand_path("../lib", __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require "gobig_gohome/version"
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "gobig_gohome"
8
+ spec.version = GobigGohome::VERSION
9
+ spec.authors = ["VariableX"]
10
+ spec.email = []
11
+ spec.summary = %q{"A one to four player game for big bidders!"}
12
+ spec.description = %q{"Start game with GBOGH.start(numberofplayers1-4)"}
13
+ spec.homepage = ""
14
+ spec.license = "MIT"
15
+
16
+ # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
17
+ # to allow pushing to a single host or delete this section to allow pushing to any host.
18
+ if spec.respond_to?(:metadata)
19
+ spec.metadata["allowed_push_host"] = "https://rubygems.org"
20
+ else
21
+ raise "RubyGems 2.0 or newer is required to protect against " \
22
+ "public gem pushes."
23
+ end
24
+
25
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
26
+ f.match(%r{^(test|spec|features)/})
27
+ end
28
+ spec.bindir = "exe"
29
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
30
+ spec.require_paths = ["lib"]
31
+
32
+ spec.add_development_dependency "bundler", "~> 1.16"
33
+ spec.add_development_dependency "rake", "~> 10.0"
34
+ end
@@ -0,0 +1,101 @@
1
+ require "gobig_gohome/version"
2
+
3
+ module GBOGH
4
+ def GBOGH.start(nop)
5
+ nop.to_i
6
+ p1score = 0
7
+ p2score = 0
8
+ p3score = 0
9
+ p4score = 0
10
+ p1 = true
11
+ p2 = true
12
+ p3 = true
13
+ p4 = true
14
+ if nop == 3
15
+ p4 = false
16
+ p4score = "This player is not playing."
17
+ end
18
+ if nop == 2
19
+ p3 = false
20
+ p3score = "This player is not playing."
21
+ p4 = false
22
+ p4score = "This player is not playing either."
23
+ end
24
+ if nop == 1
25
+ p2 = false
26
+ p2score = "This player is not playing."
27
+ p3 = false
28
+ p3score = "This player is not playing either."
29
+ p4 = false
30
+ p4score = "This player is not playing, just like P2 and P3! This must be a one player game."
31
+ end
32
+ t = 0
33
+ puts "Go Big or Go Home is a game about betting high enough, but not too high.\nEach round, of which there are six, ten dice are rolled. You will be told the highest number.\nYou then bid a number from zero to three.\nThe dice are added up, then multiplied by your bid and added to your score."
34
+ 6.times do
35
+ v1 = rand(-10..10)
36
+ v2 = rand(-10..10)
37
+ v3 = rand(-10..10)
38
+ v4 = rand(-10..10)
39
+ v5 = rand(-10..10)
40
+ v6 = rand(-10..10)
41
+ v7 = rand(-10..10)
42
+ v8 = rand(-10..10)
43
+ v9 = rand(-10..10)
44
+ v10 = rand(-10..10)
45
+ max = [v1, v2, v3, v4, v5, v6, v7, v8, v9, v10].max
46
+ sum = v1 + v2 + v3 + v4 + v5 + v6 + v7 + v8 + v9 + v10
47
+ puts "The highest die (from -10 to 10), is #{max}."
48
+ if p1 == true
49
+ print "P1 bid: "
50
+ p1bid = Integer(gets.chomp)
51
+ if p1bid > 3
52
+ p1bid = 3
53
+ end
54
+ if p1bid < 0
55
+ p1bid = 0
56
+ end
57
+ p1score = p1score + (p1bid*sum)
58
+ end
59
+ if p2 == true
60
+ print "P2 bid: "
61
+ p2bid = Integer(gets.chomp)
62
+ if p2bid > 3
63
+ p2bid = 3
64
+ end
65
+ if p2bid < 0
66
+ p2bid = 0
67
+ end
68
+ p2score = p2score + (p2bid*sum)
69
+ end
70
+ if p3 == true
71
+ print "P3 bid: "
72
+ p3bid = Integer(gets.chomp)
73
+ if p3bid > 3
74
+ p3bid = 3
75
+ end
76
+ if p3bid < 0
77
+ p3bid = 0
78
+ end
79
+ p3score = p3score + (p3bid*sum)
80
+ end
81
+ if p4 == true
82
+ print "P4 bid: "
83
+ p4bid = Integer(gets.chomp)
84
+ if p4bid > 3
85
+ p4bid = 3
86
+ end
87
+ if p4bid < 0
88
+ p4bid = 0
89
+ end
90
+ p4score = p4score + (p4bid*sum)
91
+ end
92
+ puts "The sum was #{sum}."
93
+ t = t + 1
94
+ if t < 6
95
+ puts "P1 Score: #{p1score}\nP2 Score: #{p2score}\nP3 Score: #{p3score}\nP4 Score: #{p4score}"
96
+ else
97
+ puts "P1 Final Score: #{p1score}\nP2 Final Score: #{p2score}\nP3 Final Score: #{p3score}\nP4 Final Score: #{p4score}"
98
+ end
99
+ end
100
+ end
101
+ end
@@ -0,0 +1,3 @@
1
+ module GobigGohome
2
+ VERSION = "0.1.0"
3
+ end
metadata ADDED
@@ -0,0 +1,82 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: gobig_gohome
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - VariableX
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2018-01-18 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.16'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.16'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ description: '"Start game with GBOGH.start(numberofplayers1-4)"'
42
+ email: []
43
+ executables: []
44
+ extensions: []
45
+ extra_rdoc_files: []
46
+ files:
47
+ - ".gitignore"
48
+ - Gemfile
49
+ - LICENSE.txt
50
+ - README.md
51
+ - Rakefile
52
+ - bin/console
53
+ - bin/setup
54
+ - gobig_gohome.gemspec
55
+ - lib/gobig_gohome.rb
56
+ - lib/gobig_gohome/version.rb
57
+ homepage: ''
58
+ licenses:
59
+ - MIT
60
+ metadata:
61
+ allowed_push_host: https://rubygems.org
62
+ post_install_message:
63
+ rdoc_options: []
64
+ require_paths:
65
+ - lib
66
+ required_ruby_version: !ruby/object:Gem::Requirement
67
+ requirements:
68
+ - - ">="
69
+ - !ruby/object:Gem::Version
70
+ version: '0'
71
+ required_rubygems_version: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ requirements: []
77
+ rubyforge_project:
78
+ rubygems_version: 2.6.8
79
+ signing_key:
80
+ specification_version: 4
81
+ summary: '"A one to four player game for big bidders!"'
82
+ test_files: []