Решение на Шеста задача от Ангел Миланов
Обратно към всички решения
Към профила на Ангел Миланов
Резултати
- 5 точки от тестове
- 1 отнета точка
- 4 точки общо
- 14 успешни тест(а)
- 4 неуспешни тест(а)
Код
Лог от изпълнението
......F........FFF
Failures:
1) GameOfLife::Board GameOfLife::Board enumeration live cells count returns the number of live cells on a board
Failure/Error: new_board([0, 0], [1, 1], [0, 0]).count.should eq 2
expected: 2
got: 3
(compared using ==)
# /tmp/d20111221-3114-dr8az0/spec.rb:46:in `block (4 levels) in <top (required)>'
# ./lib/homework/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/homework/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
2) GameOfLife::Board GameOfLife::Board evolution rules evolves a formation correctly
Failure/Error: board.count.should eq cells.count
expected: 7
got: 9
(compared using ==)
# /tmp/d20111221-3114-dr8az0/spec.rb:172:in `expect_generation_in'
# /tmp/d20111221-3114-dr8az0/spec.rb:136:in `block (4 levels) in <top (required)>'
# ./lib/homework/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/homework/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
3) GameOfLife::Board GameOfLife::Board evolution rules oscilates the oscilators
Failure/Error: board.count.should eq cells.count
expected: 3
got: 7
(compared using ==)
# /tmp/d20111221-3114-dr8az0/spec.rb:172:in `expect_generation_in'
# /tmp/d20111221-3114-dr8az0/spec.rb:145:in `block (5 levels) in <top (required)>'
# /tmp/d20111221-3114-dr8az0/spec.rb:142:in `times'
# /tmp/d20111221-3114-dr8az0/spec.rb:142:in `block (4 levels) in <top (required)>'
# ./lib/homework/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/homework/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
4) GameOfLife::Board GameOfLife::Board evolution rules keeps stable formations stable
Failure/Error: board.count.should eq cells.count
expected: 4
got: 12
(compared using ==)
# /tmp/d20111221-3114-dr8az0/spec.rb:172:in `expect_generation_in'
# /tmp/d20111221-3114-dr8az0/spec.rb:160:in `block (6 levels) in <top (required)>'
# /tmp/d20111221-3114-dr8az0/spec.rb:158:in `times'
# /tmp/d20111221-3114-dr8az0/spec.rb:158:in `block (5 levels) in <top (required)>'
# /tmp/d20111221-3114-dr8az0/spec.rb:155:in `each'
# /tmp/d20111221-3114-dr8az0/spec.rb:155:in `block (4 levels) in <top (required)>'
# ./lib/homework/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/homework/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
Finished in 0.34206 seconds
18 examples, 4 failures
Failed examples:
rspec /tmp/d20111221-3114-dr8az0/spec.rb:43 # GameOfLife::Board GameOfLife::Board enumeration live cells count returns the number of live cells on a board
rspec /tmp/d20111221-3114-dr8az0/spec.rb:129 # GameOfLife::Board GameOfLife::Board evolution rules evolves a formation correctly
rspec /tmp/d20111221-3114-dr8az0/spec.rb:139 # GameOfLife::Board GameOfLife::Board evolution rules oscilates the oscilators
rspec /tmp/d20111221-3114-dr8az0/spec.rb:151 # GameOfLife::Board GameOfLife::Board evolution rules keeps stable formations stable
История (1 версия и 1 коментар)
Ангел обнови решението на 17.12.2011 12:23 (преди около 13 години)