Решение на Шеста задача от Димитър Ангелов
Обратно към всички решения
Към профила на Димитър Ангелов
Резултати
- 3 точки от тестове
- 2 отнети точки
- 1 точка общо
- 6 успешни тест(а)
- 8 неуспешни тест(а)
Код
Лог от изпълнението
..FFF....FFFFF
Failures:
1) TurtleGraphics Turtle #draw #move moves the turtle to the start of row or column when we are at its end
Failure/Error: 3.times { move }
NoMethodError:
undefined method `+' for nil:NilClass
# /tmp/d20151203-5272-5s8z6/solution.rb:30:in `move'
# /tmp/d20151203-5272-5s8z6/spec.rb:16:in `block (7 levels) in <top (required)>'
# /tmp/d20151203-5272-5s8z6/spec.rb:16:in `times'
# /tmp/d20151203-5272-5s8z6/spec.rb:16:in `block (6 levels) in <top (required)>'
# /tmp/d20151203-5272-5s8z6/solution.rb:21:in `instance_eval'
# /tmp/d20151203-5272-5s8z6/solution.rb:21:in `draw'
# /tmp/d20151203-5272-5s8z6/spec.rb:4:in `create_canvas'
# /tmp/d20151203-5272-5s8z6/spec.rb:15:in `block (5 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
2) TurtleGraphics Turtle #draw #move keeps the orientation when we get out of column
Failure/Error: 4.times { move }
NoMethodError:
undefined method `[]' for nil:NilClass
# /tmp/d20151203-5272-5s8z6/solution.rb:32:in `move'
# /tmp/d20151203-5272-5s8z6/spec.rb:36:in `block (7 levels) in <top (required)>'
# /tmp/d20151203-5272-5s8z6/spec.rb:36:in `times'
# /tmp/d20151203-5272-5s8z6/spec.rb:36:in `block (6 levels) in <top (required)>'
# /tmp/d20151203-5272-5s8z6/solution.rb:21:in `instance_eval'
# /tmp/d20151203-5272-5s8z6/solution.rb:21:in `draw'
# /tmp/d20151203-5272-5s8z6/spec.rb:4:in `create_canvas'
# /tmp/d20151203-5272-5s8z6/spec.rb:34:in `block (5 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
3) TurtleGraphics Turtle #draw #move counts the times we have passed through every cell
Failure/Error: 2.times { move }
NoMethodError:
undefined method `+' for nil:NilClass
# /tmp/d20151203-5272-5s8z6/solution.rb:30:in `move'
# /tmp/d20151203-5272-5s8z6/spec.rb:47:in `block (7 levels) in <top (required)>'
# /tmp/d20151203-5272-5s8z6/spec.rb:47:in `times'
# /tmp/d20151203-5272-5s8z6/spec.rb:47:in `block (6 levels) in <top (required)>'
# /tmp/d20151203-5272-5s8z6/solution.rb:21:in `instance_eval'
# /tmp/d20151203-5272-5s8z6/solution.rb:21:in `draw'
# /tmp/d20151203-5272-5s8z6/spec.rb:4:in `create_canvas'
# /tmp/d20151203-5272-5s8z6/spec.rb:46:in `block (5 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
4) TurtleGraphics Canvas::ASCII renders the proper symbols depending on the intensity
Failure/Error: ascii = TurtleGraphics::Turtle.new(3, 3).draw(ascii_canvas) do
NoMethodError:
undefined method `flatten' for nil:NilClass
# /tmp/d20151203-5272-5s8z6/solution.rb:63:in `draw_ascii'
# /tmp/d20151203-5272-5s8z6/solution.rb:55:in `what_to_draw'
# /tmp/d20151203-5272-5s8z6/solution.rb:22:in `draw'
# /tmp/d20151203-5272-5s8z6/spec.rb:114:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
5) TurtleGraphics Canvas::ASCII can render with a different number of symbols
Failure/Error: ascii = TurtleGraphics::Turtle.new(3, 3).draw(ascii_canvas) do
NoMethodError:
undefined method `flatten' for nil:NilClass
# /tmp/d20151203-5272-5s8z6/solution.rb:63:in `draw_ascii'
# /tmp/d20151203-5272-5s8z6/solution.rb:55:in `what_to_draw'
# /tmp/d20151203-5272-5s8z6/solution.rb:22:in `draw'
# /tmp/d20151203-5272-5s8z6/spec.rb:137:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
6) TurtleGraphics Canvas::HTML renders the proper template
Failure/Error: expect(canvas.gsub(/\s+/, '')).to eq <<-HTML.gsub(/\s+/, '')
NoMethodError:
undefined method `gsub' for nil:NilClass
# /tmp/d20151203-5272-5s8z6/spec.rb:171:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
7) TurtleGraphics Canvas::HTML sets the pixel size of the table
Failure/Error: expect(canvas.gsub(/\s+/, '')).to include <<-HTML.gsub(/\s+/, '')
NoMethodError:
undefined method `gsub' for nil:NilClass
# /tmp/d20151203-5272-5s8z6/spec.rb:220:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
8) TurtleGraphics Canvas::HTML changes the opacity of a cell based on the times we have passed
Failure/Error: expect(canvas.gsub(/\s+/, '')).to include <<-HTML.gsub(/\s+/, '')
NoMethodError:
undefined method `gsub' for nil:NilClass
# /tmp/d20151203-5272-5s8z6/spec.rb:242:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
Finished in 0.00857 seconds
14 examples, 8 failures
Failed examples:
rspec /tmp/d20151203-5272-5s8z6/spec.rb:14 # TurtleGraphics Turtle #draw #move moves the turtle to the start of row or column when we are at its end
rspec /tmp/d20151203-5272-5s8z6/spec.rb:33 # TurtleGraphics Turtle #draw #move keeps the orientation when we get out of column
rspec /tmp/d20151203-5272-5s8z6/spec.rb:45 # TurtleGraphics Turtle #draw #move counts the times we have passed through every cell
rspec /tmp/d20151203-5272-5s8z6/spec.rb:112 # TurtleGraphics Canvas::ASCII renders the proper symbols depending on the intensity
rspec /tmp/d20151203-5272-5s8z6/spec.rb:135 # TurtleGraphics Canvas::ASCII can render with a different number of symbols
rspec /tmp/d20151203-5272-5s8z6/spec.rb:165 # TurtleGraphics Canvas::HTML renders the proper template
rspec /tmp/d20151203-5272-5s8z6/spec.rb:218 # TurtleGraphics Canvas::HTML sets the pixel size of the table
rspec /tmp/d20151203-5272-5s8z6/spec.rb:227 # TurtleGraphics Canvas::HTML changes the opacity of a cell based on the times we have passed
История (1 версия и 1 коментар)
Димитър обнови решението на 02.12.2015 13:39 (преди около 9 години)