conway_deathmatch 0.0.0.1 → 0.0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/conway_deathmatch +13 -6
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0ca0e558f451043c8f3ebfa295f1e2f8fbcd830b
|
4
|
+
data.tar.gz: 03eb10439f8cdda6c0d5be94a91b80b57382c454
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9bedf785b8e31f8a316e0d7dfd8722011b0a9710c05668596e051451ccb5e29e439fc63d2acbde659881a134a7abab743b6605d5f379997dbfa5af8b99b7e6bf
|
7
|
+
data.tar.gz: 27f7379ab555965acc4302c6ef9b34a3cb554b935ee07d1e0cded678423793ffce2b796187d9837d9bca7a664309aa25da4038f686c2dcbaad24265da56f3652
|
data/bin/conway_deathmatch
CHANGED
@@ -9,24 +9,25 @@ opts = Slop.parse(help: true,
|
|
9
9
|
optional_arguments: true) do
|
10
10
|
banner 'Usage: conway_deathmatch [options]'
|
11
11
|
|
12
|
-
on 'w', 'width=',
|
13
|
-
on 'height=',
|
12
|
+
on 'w', 'width=', '[int] Board width', as: Integer
|
13
|
+
on 'height=', '[int] Board height', as: Integer
|
14
14
|
on 'n', 'num_ticks=', '[int] Max number of ticks to generate', as: Integer
|
15
15
|
on 's', 'sleep=', '[flt] Sleep duration', as: Float
|
16
16
|
on 'p', 'points=', '[str] e.g. "acorn 50 18 p 1 2 p 3 4"', as: String
|
17
17
|
on 'S', 'step', 'Hold ticks for user input'
|
18
18
|
on 'silent', 'Only render the final state'
|
19
19
|
on 'm', 'multiplayer', 'Use multiplayer evaluation'
|
20
|
+
on 'one=', '[str] points for population "1"'
|
21
|
+
on 'two=', '[str] points for population "2"'
|
22
|
+
on 'three=', '[str] points for population "3"'
|
20
23
|
end
|
21
24
|
width = opts[:width] || 70
|
22
25
|
height = opts[:height] || 40
|
23
|
-
# assumes 1P, TODO: figure out MP
|
24
26
|
shapes = opts[:points] || "acorn 50 18"
|
25
27
|
slp = opts[:sleep] || 0.02
|
26
28
|
n = opts[:num_ticks]
|
27
29
|
render_continuous = (n.nil? or !opts.silent?)
|
28
30
|
|
29
|
-
|
30
31
|
# create game
|
31
32
|
#
|
32
33
|
require 'conway_deathmatch'
|
@@ -34,8 +35,14 @@ require 'conway_deathmatch/shapes'
|
|
34
35
|
|
35
36
|
include ConwayGame
|
36
37
|
b = BoardState.new(width, height)
|
37
|
-
|
38
|
-
b.multiplayer =
|
38
|
+
if opts.multiplayer? or opts[:one] or opts[:two] or opts[:three]
|
39
|
+
b.multiplayer = true
|
40
|
+
end
|
41
|
+
|
42
|
+
Shapes.add(b, opts[:one], 1) if opts[:one]
|
43
|
+
Shapes.add(b, opts[:two], 2) if opts[:two]
|
44
|
+
Shapes.add(b, opts[:three], 3) if opts[:three]
|
45
|
+
Shapes.add(b, shapes) unless b.multiplayer
|
39
46
|
|
40
47
|
# play game
|
41
48
|
#
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: conway_deathmatch
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.0.
|
4
|
+
version: 0.0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rick Hull
|
@@ -20,7 +20,7 @@ files:
|
|
20
20
|
- lib/conway_deathmatch.rb
|
21
21
|
- lib/conway_deathmatch/data/shapes.yaml
|
22
22
|
- lib/conway_deathmatch/shapes.rb
|
23
|
-
homepage:
|
23
|
+
homepage: https://github.com/rickhull/conway_deathmatch
|
24
24
|
licenses:
|
25
25
|
- GPL
|
26
26
|
metadata: {}
|