conwaymp 0.2.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: 8ce788b73d6c2ac5451aa0398e02b1bff4cab70d
4
+ data.tar.gz: 2823f905d3b7da9116502d633d20c0c60ea7b5a5
5
+ SHA512:
6
+ metadata.gz: cdc582b0cb596dbe9fe2f89d8de1b29307bb5b55862c759049ec227a28c8a4489283e8160705476a3529ba9a517f2e11f3a8e54f557dcf3fdb507c80067e8609
7
+ data.tar.gz: a511c5db058088848d7bb306ecaad619801f1e80b929a4e01d0285e966d2e6835bc7d2ab8e5eaf817f9a55d34b41edb541ba4084887bdc75bcaaa7084454ba36
@@ -0,0 +1,12 @@
1
+ root = true
2
+
3
+ [*]
4
+ indent_style = space
5
+ indent_size = 2
6
+ end_of_line = lf
7
+ charset = utf-8
8
+ trim_trailing_whitespace = true
9
+ insert_final_newline = true
10
+
11
+ [*.md]
12
+ trim_trailing_whitespace = false
@@ -0,0 +1,12 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+
11
+ # rspec failure tracking
12
+ .rspec_status
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
@@ -0,0 +1,18 @@
1
+ AllCops:
2
+ TargetRubyVersion: 2.4
3
+ DisplayCopNames: true
4
+
5
+ Style/Documentation:
6
+ Enabled: false
7
+
8
+ Metrics/ModuleLength:
9
+ Exclude:
10
+ - "**/*_spec.rb"
11
+
12
+ Metrics/BlockLength:
13
+ Exclude:
14
+ - "**/*_spec.rb"
15
+
16
+ Metrics/LineLength:
17
+ Exclude:
18
+ - "*.gemspec"
@@ -0,0 +1,5 @@
1
+ sudo: false
2
+ language: ruby
3
+ rvm:
4
+ - 2.4.0
5
+ before_install: gem install bundler -v 1.14.5
data/Gemfile ADDED
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+ source 'https://rubygems.org'
3
+
4
+ # Specify your gem's dependencies in conwaymp.gemspec
5
+ gemspec
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ guard :rspec, cmd: 'bundle exec rspec' do
4
+ require 'guard/rspec/dsl'
5
+ dsl = Guard::RSpec::Dsl.new(self)
6
+
7
+ # RSpec files
8
+ rspec = dsl.rspec
9
+ watch(rspec.spec_helper) { rspec.spec_dir }
10
+ watch(rspec.spec_support) { rspec.spec_dir }
11
+ watch(rspec.spec_files)
12
+
13
+ # Ruby files
14
+ ruby = dsl.ruby
15
+ dsl.watch_spec_files_for(ruby.lib_files)
16
+ end
@@ -0,0 +1,28 @@
1
+ # Conwaymp
2
+
3
+ A sample version of [Conway's Game of Life](https://en.wikipedia.org/wiki/Conway's_Game_of_Life) for the MarketPlacer Jnr Rails position.
4
+
5
+ ## Installation
6
+
7
+ `$ gem install conwaymp`
8
+
9
+ ## Usage
10
+
11
+ ```$ conway --help
12
+ usage: conway [options]
13
+ -r, --rows Rows. Default: 20
14
+ -c, --cols Columns. Default: 20
15
+ -l, --load Path to board state to load
16
+ -s, --seed Load a seed
17
+ -ls, --seeds List available seeds
18
+ --version print the version
19
+ --help
20
+ ```
21
+
22
+ ## TODO
23
+
24
+ * Load file size verification
25
+ * Tidying up
26
+ * Better neighbour finding
27
+ * Somehow reduce the constant mapping/eaching?
28
+ * More tests
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+ require 'bundler/gem_tasks'
3
+ require 'rspec/core/rake_task'
4
+
5
+ RSpec::Core::RakeTask.new(:spec)
6
+
7
+ task default: :spec
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require 'bundler/setup'
5
+ require 'conwaymp'
6
+
7
+ require 'pry'
8
+ Pry.start(__FILE__)
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require 'bundler/setup'
5
+ require 'conwaymp'
6
+
7
+ game = Conwaymp::Game.new
8
+
9
+ game.play
@@ -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,37 @@
1
+ # coding: utf-8
2
+ # frozen_string_literal: true
3
+ lib = File.expand_path('../lib', __FILE__)
4
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
+ require 'conwaymp/version'
6
+
7
+ Gem::Specification.new do |spec|
8
+ spec.name = 'conwaymp'
9
+ spec.version = Conwaymp::VERSION
10
+ spec.authors = ['Rob McFadzean']
11
+ spec.email = ['root@sphericalcube.net']
12
+
13
+ spec.summary = "Conway's Game of Life Test for MarketPlacer"
14
+ spec.description = 'My implementation of GoL for the Junior Ruby/Rails position at MarketPlacer'
15
+ spec.homepage = 'https://github.com/rmcfadzean/conway'
16
+
17
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
18
+ f.match(%r{^(test|spec|features)/})
19
+ end
20
+ spec.bindir = 'bin'
21
+ spec.executables = spec.files.grep(%r{^bin/conway}) { |f| File.basename(f) }
22
+ spec.require_paths = ['lib']
23
+
24
+ spec.add_dependency 'colorize'
25
+ spec.add_dependency 'slop', '~> 4.0'
26
+ spec.add_dependency 'hanami-validations'
27
+
28
+ spec.add_development_dependency 'bundler', '~> 1.14'
29
+ spec.add_development_dependency 'rake', '~> 10.0'
30
+ spec.add_development_dependency 'rspec', '~> 3.0'
31
+ spec.add_development_dependency 'rubocop'
32
+ spec.add_development_dependency 'guard'
33
+ spec.add_development_dependency 'guard-rspec'
34
+ spec.add_development_dependency 'pry', '~> 0.11.0.pre2'
35
+ spec.add_development_dependency 'awesome_print'
36
+ spec.add_development_dependency 'simplecov'
37
+ end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+ require 'colorize'
3
+ require 'slop'
4
+ require 'hanami/validations'
5
+
6
+ require 'conwaymp/version'
7
+ require 'conwaymp/game'
8
+ require 'conwaymp/options'
9
+ require 'conwaymp/board'
10
+ require 'conwaymp/cell'
@@ -0,0 +1,131 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Conwaymp
4
+ class Board
5
+ attr_reader :grid
6
+
7
+ def initialize(opts)
8
+ @opts = opts
9
+ @sleep_time = 0.5 # Seconds
10
+
11
+ # Initialize the board
12
+ @grid = []
13
+
14
+ # Initialize the stats
15
+ @state = {
16
+ tick: 0
17
+ }
18
+
19
+ generate_grid
20
+
21
+ seed_file = @opts[:load] || @opts[:seed]
22
+
23
+ seed_grid(seed_file, !@opts[:seed].nil?) if seed_file
24
+ end
25
+
26
+ def generate_grid
27
+ @opts[:rows].times do
28
+ @grid << Array.new(@opts[:cols]) { Cell.new }
29
+ end
30
+ end
31
+
32
+ def clear_grid
33
+ @grid.flatten.map(&:die!) # Kill all cells
34
+ end
35
+
36
+ def seed_grid(path, is_included)
37
+ clear_grid
38
+
39
+ if is_included
40
+ path = File.expand_path("../../../seeds/#{path}", __FILE__)
41
+ end
42
+
43
+ file = File.read(File.expand_path(path))
44
+
45
+ file.split.each_with_index do |r, ri|
46
+ r.split(',').each_with_index do |c, ci|
47
+ @grid[ri][ci].rebirth! if c == '1'
48
+ end
49
+ end
50
+ end
51
+
52
+ # TODO: This method feels wrong.
53
+ # I'm sure there's something here that can be done with permutations?
54
+ def possible_neighbours_of(row, col)
55
+ [
56
+ [row - 1, col], # N
57
+ [row, col + 1], # E
58
+ [row + 1, col], # S
59
+ [row, col - 1], # W
60
+ [row + 1, col + 1], # SE
61
+ [row - 1, col - 1], # NW
62
+ [row + 1, col - 1], # SW
63
+ [row - 1, col + 1], # NE
64
+ ]
65
+ .select do |r, c|
66
+ # Ensure they're within bounds
67
+ (0..@opts[:rows] - 1).cover?(r) &&
68
+ (0..@opts[:cols] - 1).cover?(c)
69
+ end
70
+ end
71
+
72
+ def neighbours_of(row, col)
73
+ cell = @grid[row][col]
74
+
75
+ neighbours = []
76
+
77
+ possible_neighbours_of(row, col).each do |r, c|
78
+ neighbours << @grid[r][c]
79
+ end
80
+
81
+ cell.living_neighbours = neighbours.select(&:alive?).count
82
+
83
+ neighbours
84
+ end
85
+
86
+ def population
87
+ @grid.flatten.select(&:alive?).count
88
+ end
89
+
90
+ def print_board
91
+ puts "\e[H\e[2J" # Clear the screen
92
+
93
+ map = @grid.map do |row|
94
+ row.map(&:print).join('')
95
+ end.join("\n")
96
+
97
+ puts map
98
+ end
99
+
100
+ # TODO: Tidy?
101
+ def print_stats
102
+ puts ' + ' * @opts[:cols]
103
+ puts "Tick: #{@state[:tick]}\t Pop.: #{population}"
104
+ .center(@opts[:cols] * 3)
105
+ end
106
+
107
+ def display
108
+ print_board
109
+ print_stats
110
+ end
111
+
112
+ def tick
113
+ @state[:tick] += 1
114
+
115
+ (0..(@opts[:rows] - 1)).each do |row|
116
+ (0..(@opts[:cols] - 1)).each do |col|
117
+ neighbours_of(row, col)
118
+ end
119
+ end
120
+
121
+ @grid = @grid.map do |row|
122
+ row.map do |cell|
123
+ cell.tick
124
+ cell
125
+ end
126
+ end
127
+
128
+ sleep @sleep_time
129
+ end
130
+ end
131
+ end
@@ -0,0 +1,58 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Conwaymp
4
+ class Cell
5
+ attr_accessor :state, :living_neighbours
6
+
7
+ def initialize(state = nil)
8
+ @state = state || (0.15 > rand ? :alive : :dead)
9
+ @living_neighbours = 0
10
+
11
+ @icons = {
12
+ alive: ' # '.colorize(:green),
13
+ dead: ' . '.colorize(:red)
14
+ }
15
+ end
16
+
17
+ def print
18
+ @icons[@state]
19
+ end
20
+
21
+ def tick
22
+ die! if underpopulated? || overpopulated?
23
+ rebirth! if repopulate? || survives?
24
+ end
25
+
26
+ def underpopulated?
27
+ living_neighbours < 2 && alive?
28
+ end
29
+
30
+ def overpopulated?
31
+ living_neighbours > 3 && alive?
32
+ end
33
+
34
+ def repopulate?
35
+ living_neighbours == 3 && dead?
36
+ end
37
+
38
+ def survives?
39
+ ((2..3).cover? living_neighbours) && alive?
40
+ end
41
+
42
+ def alive?
43
+ @state == :alive
44
+ end
45
+
46
+ def dead?
47
+ @state == :dead
48
+ end
49
+
50
+ def rebirth!
51
+ @state = :alive
52
+ end
53
+
54
+ def die!
55
+ @state = :dead
56
+ end
57
+ end
58
+ end
@@ -0,0 +1,63 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Conwaymp
4
+ class Game
5
+ attr_accessor :board
6
+
7
+ def initialize
8
+ @errors = []
9
+
10
+ @options = Options.new(parse_options).validate
11
+
12
+ if @options.success?
13
+ @board = Board.new(@options)
14
+ else
15
+ display_errors(@options.errors)
16
+ end
17
+ end
18
+
19
+ def play
20
+ loop do
21
+ @board.display
22
+ @board.tick
23
+ end
24
+ end
25
+
26
+ def parse_options
27
+ @options = Slop.parse suppress_errors: true do |o|
28
+ o.integer '-r', '--rows', 'Rows. Default: 20', default: 20
29
+ o.integer '-c', '--cols', 'Columns. Default: 20', default: 20
30
+ o.string '-l', '--load', 'Path to board state to load'
31
+ o.string '-s', '--seed', 'Load a seed'
32
+ o.on '-ls', '--seeds', 'List available seeds' do
33
+ puts 'Available Seeds:'
34
+ puts Conwaymp::Game.available_seeds
35
+ exit
36
+ end
37
+ o.on '--version', 'print the version' do
38
+ puts Conwaymp::VERSION
39
+ exit
40
+ end
41
+ o.on '--help' do
42
+ puts o
43
+ exit
44
+ end
45
+ end
46
+ end
47
+
48
+ def display_errors errors
49
+ errors = errors.map do |k,e|
50
+ "#{k}: #{e.join(',')}".colorize(:red)
51
+ end
52
+ puts errors
53
+ puts parse_options
54
+ exit
55
+ end
56
+
57
+ def self.available_seeds
58
+ Dir.glob(File.expand_path('../../../seeds/*', __FILE__)).map do |f|
59
+ File.basename(f)
60
+ end
61
+ end
62
+ end
63
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Conwaymp
4
+ class Options
5
+ include Hanami::Validations
6
+
7
+ predicate :file_exists?, message: 'file must exist' do |current|
8
+ File.exist?(File.expand_path(current))
9
+ end
10
+
11
+ validations do
12
+ optional(:seed) { str? > included_in?(Conwaymp::Game.available_seeds) }
13
+
14
+ required(:rows) { int? & included_in?(1..100) }
15
+ required(:cols) { int? & included_in?(1..100) }
16
+
17
+ optional(:load) { str? > file_exists? }
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Conwaymp
4
+ VERSION = '0.2.0'
5
+ end
@@ -0,0 +1,20 @@
1
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
2
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
3
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
4
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
5
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
6
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
7
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
8
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
9
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
10
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
11
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
12
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
13
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
14
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
15
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
16
+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,0
3
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
4
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
5
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
6
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
7
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
8
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
9
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
10
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
11
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
12
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
13
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
14
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
15
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
16
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
17
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
18
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
19
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
20
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
metadata ADDED
@@ -0,0 +1,236 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: conwaymp
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.0
5
+ platform: ruby
6
+ authors:
7
+ - Rob McFadzean
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2017-03-18 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: colorize
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: slop
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '4.0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '4.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: hanami-validations
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: bundler
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '1.14'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '1.14'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rake
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '10.0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '10.0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rspec
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '3.0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '3.0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: rubocop
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: guard
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: guard-rspec
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: pry
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - "~>"
144
+ - !ruby/object:Gem::Version
145
+ version: 0.11.0.pre2
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - "~>"
151
+ - !ruby/object:Gem::Version
152
+ version: 0.11.0.pre2
153
+ - !ruby/object:Gem::Dependency
154
+ name: awesome_print
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - ">="
158
+ - !ruby/object:Gem::Version
159
+ version: '0'
160
+ type: :development
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - ">="
165
+ - !ruby/object:Gem::Version
166
+ version: '0'
167
+ - !ruby/object:Gem::Dependency
168
+ name: simplecov
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - ">="
172
+ - !ruby/object:Gem::Version
173
+ version: '0'
174
+ type: :development
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - ">="
179
+ - !ruby/object:Gem::Version
180
+ version: '0'
181
+ description: My implementation of GoL for the Junior Ruby/Rails position at MarketPlacer
182
+ email:
183
+ - root@sphericalcube.net
184
+ executables:
185
+ - conway
186
+ extensions: []
187
+ extra_rdoc_files: []
188
+ files:
189
+ - ".editorconfig"
190
+ - ".gitignore"
191
+ - ".rspec"
192
+ - ".rubocop.yml"
193
+ - ".travis.yml"
194
+ - Gemfile
195
+ - Guardfile
196
+ - README.md
197
+ - Rakefile
198
+ - bin/console
199
+ - bin/conway
200
+ - bin/setup
201
+ - conwaymp.gemspec
202
+ - lib/conwaymp.rb
203
+ - lib/conwaymp/board.rb
204
+ - lib/conwaymp/cell.rb
205
+ - lib/conwaymp/game.rb
206
+ - lib/conwaymp/options.rb
207
+ - lib/conwaymp/version.rb
208
+ - seeds/dead
209
+ - seeds/exploder
210
+ - seeds/glider
211
+ - seeds/hireme
212
+ - seeds/oscillator
213
+ homepage: https://github.com/rmcfadzean/conway
214
+ licenses: []
215
+ metadata: {}
216
+ post_install_message:
217
+ rdoc_options: []
218
+ require_paths:
219
+ - lib
220
+ required_ruby_version: !ruby/object:Gem::Requirement
221
+ requirements:
222
+ - - ">="
223
+ - !ruby/object:Gem::Version
224
+ version: '0'
225
+ required_rubygems_version: !ruby/object:Gem::Requirement
226
+ requirements:
227
+ - - ">="
228
+ - !ruby/object:Gem::Version
229
+ version: '0'
230
+ requirements: []
231
+ rubyforge_project:
232
+ rubygems_version: 2.6.8
233
+ signing_key:
234
+ specification_version: 4
235
+ summary: Conway's Game of Life Test for MarketPlacer
236
+ test_files: []