mastermind_ruby 0.0.1 → 0.0.3

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: a3ad4cf50286b09c3bec1e6e74f96642b075a346
4
- data.tar.gz: 44a19863fda1c35ace0ce9ba35e6dd8c9eb960eb
3
+ metadata.gz: 4b265a9601800fa81f1b0ccff86b65c5d57066b4
4
+ data.tar.gz: e8f10788313f1e9faf38c2e644175f0aae8a5d6f
5
5
  SHA512:
6
- metadata.gz: a6b55153f5459955aed6b529d6597a4bb7e105773c9947a75543806e59b9079bb98d16a91a5dc26be6f49ce41d6efc239b2629777cc865c77ffc103e480d4fa0
7
- data.tar.gz: 75f75a96928525d51d61356502442d2a1018425ffe4744ba035a3ac42f9a113ee32f9e8feb124e9211d64c11c437434f7dcdde769d4013799e4f4c11f0ef1080
6
+ metadata.gz: bfc794183bf2b29fa43d958a6259707755bfcb9bdaf7d64b9b1122e27c8a5f5e9c8dee520b67576db3b73ea89d53964e31c0cdfa6db685c5a189a0702643cd95
7
+ data.tar.gz: d4eeede3205907fed91e63293c867bf1ee7f758feb000564e50c4524fe683645f602ff38ccdba5cedc5044023d30e6f342fe90ffe763a4a955e45959b52b5550
@@ -0,0 +1,2 @@
1
+
2
+ *.gem
@@ -0,0 +1 @@
1
+ 2.2.2
data/Gemfile ADDED
@@ -0,0 +1,2 @@
1
+ source "https://rubygems.org"
2
+ gemspec
@@ -0,0 +1,20 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ mastermind_ruby (0.0.3)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ rake (10.4.2)
10
+
11
+ PLATFORMS
12
+ ruby
13
+
14
+ DEPENDENCIES
15
+ bundler
16
+ mastermind_ruby!
17
+ rake
18
+
19
+ BUNDLED WITH
20
+ 1.10.6
@@ -0,0 +1 @@
1
+ # Mastermind_ruby
@@ -0,0 +1,26 @@
1
+ require "bundler/gem_tasks"
2
+
3
+ task :default => :test
4
+
5
+ desc 'Run all tests'
6
+ task :test => ["test:unit", "test:integration"]
7
+
8
+ namespace :test do
9
+ desc 'Run all unit tests'
10
+ task :unit do
11
+ puts "----------- Running unit tests ------------"
12
+ file_list = FileList.new('test/unit/*_test.rb')
13
+ file_list.each { |file| require_relative file }
14
+ end
15
+
16
+ desc 'Run all integration tests'
17
+ task :integration do
18
+ puts "----------- Running integration tests ------------"
19
+ file_list = FileList.new('test/integration/*_test.rb')
20
+ file_list.each { |file| require_relative file }
21
+ end
22
+ end
23
+
24
+ task :run do
25
+ trap(0) { system "exe/mastermind" }
26
+ end
data/TODO.md ADDED
@@ -0,0 +1,35 @@
1
+ # Phase I
2
+
3
+ * Das Spiel hat 6 verschieden Farben für die Codes.
4
+ * R (red)
5
+ * Y (yellow)
6
+ * G (green)
7
+ * O (orange)
8
+ * M (magenta)
9
+ * P (purple)
10
+ * Die Bewertung der Codes ist wie folgt:
11
+ * W (white): richtige Farbe an der falschen Position
12
+ * B (black): richtige Farbe an der richtigen Position
13
+ * Das Spiel kann über die Kommandozeile gestartet werden. `ruby mastermind.rb`
14
+ * Nach dem Starten generiert das Programm den geheim Code (4 stellen)
15
+ * Darauf wird der Benutzer über die Kommandozeiel zur eingabe eines Codes
16
+ aufgefordert.
17
+ * Nach der Eingabe des Codes gibt das Programm die entsprechende Bewertung aus.
18
+
19
+ Ein möglicher Programmverlauf wäre wie folgt:
20
+
21
+ ```
22
+ $ ruby mastermind.rb
23
+ RRRR
24
+ => BB--
25
+ RRYY
26
+ => WBW-
27
+ RYRP
28
+ => WBW-
29
+ YRRM
30
+ => BBB-
31
+ YRRO
32
+ => BBBB
33
+
34
+ Code cracked in 5 turns.
35
+ ```
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'rake' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('rake', 'rake')
@@ -0,0 +1,3 @@
1
+ module MastermindRuby
2
+ VERSION = "0.0.3"
3
+ end
@@ -0,0 +1,24 @@
1
+ require_relative 'lib/mastermind_ruby/version'
2
+
3
+ Gem::Specification.new do |s|
4
+ s.name = 'mastermind_ruby'
5
+ s.version = MastermindRuby::VERSION
6
+ s.date = '2015-08-06'
7
+ s.summary = "A mastermind library"
8
+ s.description = "Mastermind or Master Mind is a code-breaking game for two players.
9
+ The modern game with pegs was invented in 1970 by Mordecai Meirowitz, an Israeli postmaster and telecommunications expert.
10
+ It resembles an earlier pencil and paper game called Bulls and Cows that may date back a century or more.
11
+ The library is here to reuse the game logic I wrote, and to make your game (UI) as easy as possible to manage."
12
+ s.authors = ["Yves Siegrist", "Yves Senn"]
13
+ s.email = 'y.siegrist@4teamwork.ch'
14
+ s.homepage =
15
+ 'https://github.com/Elektron1c97/Mastermind_ruby'
16
+ s.license = 'MIT'
17
+
18
+ s.add_development_dependency 'bundler'
19
+ s.add_development_dependency 'rake'
20
+
21
+ s.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
22
+ s.bindir = "exe"
23
+ s.executables = s.files.grep(%r{^exe/}) { |f| File.basename(f) }
24
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mastermind_ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yves Siegrist
@@ -10,7 +10,35 @@ autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
12
  date: 2015-08-06 00:00:00.000000000 Z
13
- dependencies: []
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: bundler
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - ">="
19
+ - !ruby/object:Gem::Version
20
+ version: '0'
21
+ type: :development
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ">="
26
+ - !ruby/object:Gem::Version
27
+ version: '0'
28
+ - !ruby/object:Gem::Dependency
29
+ name: rake
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - ">="
33
+ - !ruby/object:Gem::Version
34
+ version: '0'
35
+ type: :development
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ">="
40
+ - !ruby/object:Gem::Version
41
+ version: '0'
14
42
  description: |-
15
43
  Mastermind or Master Mind is a code-breaking game for two players.
16
44
  The modern game with pegs was invented in 1970 by Mordecai Meirowitz, an Israeli postmaster and telecommunications expert.
@@ -22,11 +50,21 @@ executables:
22
50
  extensions: []
23
51
  extra_rdoc_files: []
24
52
  files:
53
+ - ".gitignore"
54
+ - ".ruby-version"
55
+ - Gemfile
56
+ - Gemfile.lock
57
+ - README.md
58
+ - Rakefile
59
+ - TODO.md
60
+ - bin/rake
25
61
  - exe/mastermind
26
62
  - lib/mastermind_ruby.rb
27
63
  - lib/mastermind_ruby/code.rb
28
64
  - lib/mastermind_ruby/console_interface.rb
29
65
  - lib/mastermind_ruby/game.rb
66
+ - lib/mastermind_ruby/version.rb
67
+ - mastermind_ruby.gemspec
30
68
  homepage: https://github.com/Elektron1c97/Mastermind_ruby
31
69
  licenses:
32
70
  - MIT