simple_life_game 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/simple_life_game.rb +5 -5
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 48098f7cda92419170ec8c6382a269a1179ed1d0
4
- data.tar.gz: ee8e8435fb640b7e5aa7ad4e613f6f275f11bd0e
3
+ metadata.gz: bf1b43c9f1dc2d0d60a78a5b8d9448b3adae054e
4
+ data.tar.gz: 07fa8a19999969c0a18b91b841832dd0cefa0072
5
5
  SHA512:
6
- metadata.gz: 8a99c002eb195564e6e9c0e0da0124ee02159cc9f64dfea4aff3514d120300b2dd3c28f1cdbd60bcee77849c9cd530831c045767d019d14d0f666f7cf7801259
7
- data.tar.gz: eebcb38978de7ebff29ec8bf6e2aeafeda912def204252d3e349726576aaf0a3714781d7169e2afd0e387caf30b281e0555c45b8e64bd51a570c656d04c1ed38
6
+ metadata.gz: 6c63cfa1c75c614fc3d827cf0d248003213e9cc70f6c8d36756ba9d91abb906ecd6e02ce950721a7fbe23b88c246db54289ba26356ed0ca7ee72d40530ade099
7
+ data.tar.gz: 18fa9a69da7c174091d1567664d7564f16e4ed714b8658bbcaada7c137d8ae530e47bdbf62abafd2e977c7d5095d3b2f89240b45dd3c24ca87cec94165ce5a39
@@ -2,10 +2,10 @@ require "colorize"
2
2
  require_relative "cell"
3
3
 
4
4
  class LifeGame
5
- def initialize(width = 60, heigth = 40)
5
+ def initialize(width = 60, height = 40)
6
6
  @width = width
7
- @heigth = heigth
8
- @card = Array.new(heigth) { Array.new(width) { Cell.new } }
7
+ @height = height
8
+ @card = Array.new(height) { Array.new(width) { Cell.new } }
9
9
  end
10
10
 
11
11
  def next_gen!
@@ -23,8 +23,8 @@ class LifeGame
23
23
 
24
24
  private
25
25
  def alive_neighbors(y, x)
26
- up = (y == 0) ? @heigth - 1 : y - 1
27
- down = (y == @heigth - 1) ? 0 : y + 1
26
+ up = (y == 0) ? @height - 1 : y - 1
27
+ down = (y == @height - 1) ? 0 : y + 1
28
28
  left = (x == 0) ? @width - 1 : x - 1
29
29
  right = (x == @width - 1) ? 0 : x + 1
30
30
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_life_game
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aleks Senkou