lifegame 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +44 -1
- data/lib/lifegame/version.rb +1 -1
- data/lifegame.gemspec +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e2e80d6b2927a69ed97a8e142a7538ce1ddd4011b22dd4d781a15952cc93f151
|
4
|
+
data.tar.gz: f61309c22f99c50799a74137f37ed49dd3f2bf38ea891c283a9acdff9a473d6c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 546c342f21ee880a8272508e69781e0bb57705395ababddbcbe03ecb5bebe0f15d38b39265a287afd61f7a93b2c3c2925ca7f8202f53ccc96fe12fafdee66619
|
7
|
+
data.tar.gz: '05945e3ef8b12b9a4259121786eec24988e115445e6a5ed17b9b2817af6b4a6e94e30c4d5c0a1c7c211d177759807085888d1f516336ec25fabda0c627a4da38'
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,10 +1,53 @@
|
|
1
1
|
# Lifegame
|
2
2
|
|
3
|
+
Ruby CLI implementation of [Conway's Game of Life](https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life).
|
4
|
+
|
5
|
+
demo: `git clone` and `bundle install` and `bundle exec ./bin/demo`
|
6
|
+
|
3
7
|
[![demo](./demo.gif)](./demo.gif)
|
4
8
|
|
9
|
+
## Installation
|
10
|
+
|
11
|
+
Add this line to your application's Gemfile:
|
12
|
+
|
13
|
+
```ruby
|
14
|
+
gem 'lifegame'
|
15
|
+
```
|
16
|
+
And then execute:
|
17
|
+
|
18
|
+
```
|
19
|
+
$ bundle install
|
20
|
+
```
|
21
|
+
|
22
|
+
Or install it yourself as:
|
23
|
+
|
24
|
+
```
|
25
|
+
$ gem install lifegame
|
26
|
+
```
|
27
|
+
|
5
28
|
## Usage
|
6
29
|
|
7
|
-
|
30
|
+
```ruby
|
31
|
+
# 20 x 50
|
32
|
+
game = Lifegame::Lifegame.new(20, 50)
|
33
|
+
|
34
|
+
# eg: grader
|
35
|
+
game[2,7].be!; game[2,8].be!; game[2,9].be!; game[1,7].be!; game[0,8].be!
|
36
|
+
|
37
|
+
# print
|
38
|
+
puts game
|
39
|
+
|
40
|
+
# next
|
41
|
+
game.next!
|
42
|
+
puts game
|
43
|
+
|
44
|
+
# autoplay
|
45
|
+
game.start
|
46
|
+
|
47
|
+
# random with alive frequency
|
48
|
+
game.sow!(0.2)
|
49
|
+
game.start
|
50
|
+
```
|
8
51
|
|
9
52
|
## License
|
10
53
|
|
data/lib/lifegame/version.rb
CHANGED
data/lifegame.gemspec
CHANGED
@@ -8,8 +8,8 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.authors = ["oieioi"]
|
9
9
|
spec.email = ["atsuinatsu.samuifuyu@gmail.com"]
|
10
10
|
|
11
|
-
spec.summary = '
|
12
|
-
spec.description = '
|
11
|
+
spec.summary = "Conway's Game of Life"
|
12
|
+
spec.description = "Conway's Game of Life"
|
13
13
|
spec.homepage = "https://github.com/oieioi/lifegame.rb"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lifegame
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- oieioi
|
@@ -52,7 +52,7 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '3.0'
|
55
|
-
description:
|
55
|
+
description: Conway's Game of Life
|
56
56
|
email:
|
57
57
|
- atsuinatsu.samuifuyu@gmail.com
|
58
58
|
executables: []
|
@@ -99,5 +99,5 @@ requirements: []
|
|
99
99
|
rubygems_version: 3.0.3
|
100
100
|
signing_key:
|
101
101
|
specification_version: 4
|
102
|
-
summary:
|
102
|
+
summary: Conway's Game of Life
|
103
103
|
test_files: []
|