Решение на Бонус задача: ArnoldC+- от Георги Иванов
Обратно към всички решения
Към профила на Георги Иванов
Резултати
- 0 точки от тестове
- 0 бонус точки
- 0 точки общо
- 1 успешни тест(а)
- 28 неуспешни тест(а)
Код
Лог от изпълнението
.FFFFFFFFFFFFFFFFFFFFFFFFFFFF
Failures:
1) ArnoldCPM has true and false constants
Failure/Error: expect(printer).to receive(:print).with(value_to_be_printed).ordered
(Double "printer").print(0)
expected: 1 time with arguments: (0)
received: 0 times with arguments: (0)
# /tmp/d20170103-15620-iipm1l/spec.rb:878:in `block in expect_execution'
# ./lib/language/ruby/run_with_timeout.rb:7:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:7:in `block (2 levels) in <top (required)>'
2) ArnoldCPM can assign variables
Failure/Error: expect(printer).to receive(:print).with(value_to_be_printed).ordered
(Double "printer").print(42)
expected: 1 time with arguments: (42)
received: 0 times with arguments: (42)
# /tmp/d20170103-15620-iipm1l/spec.rb:878:in `block in expect_execution'
# ./lib/language/ruby/run_with_timeout.rb:7:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:7:in `block (2 levels) in <top (required)>'
3) ArnoldCPM can define and call functions with arguments
Failure/Error: expect(printer).to receive(:print).with(value_to_be_printed).ordered
(Double "printer").print(11)
expected: 1 time with arguments: (11)
received: 0 times with arguments: (11)
# /tmp/d20170103-15620-iipm1l/spec.rb:878:in `block in expect_execution'
# ./lib/language/ruby/run_with_timeout.rb:7:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:7:in `block (2 levels) in <top (required)>'
4) ArnoldCPM can define and call functions with return value
Failure/Error: get_your_ass_to_mars _invocation_result
ArgumentError:
wrong number of arguments (given 2, expected 1)
# /tmp/d20170103-15620-iipm1l/solution.rb:116:in `method_missing'
# /tmp/d20170103-15620-iipm1l/spec.rb:508:in `block (3 levels) in <top (required)>'
# /tmp/d20170103-15620-iipm1l/solution.rb:3:in `instance_eval'
# /tmp/d20170103-15620-iipm1l/solution.rb:3:in `totally_recall'
# /tmp/d20170103-15620-iipm1l/spec.rb:499:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:7:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:7:in `block (2 levels) in <top (required)>'
5) ArnoldCPM returns 0 by default
Failure/Error: ill_be_back
ArgumentError:
wrong number of arguments (given 0, expected 1)
# /tmp/d20170103-15620-iipm1l/solution.rb:143:in `ill_be_back'
# /tmp/d20170103-15620-iipm1l/spec.rb:528:in `block (3 levels) in <top (required)>'
# /tmp/d20170103-15620-iipm1l/solution.rb:3:in `instance_eval'
# /tmp/d20170103-15620-iipm1l/solution.rb:3:in `totally_recall'
# /tmp/d20170103-15620-iipm1l/spec.rb:525:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:7:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:7:in `block (2 levels) in <top (required)>'
6) ArnoldCPM can take functions as arguments
Failure/Error: because_im_going_to_say_please _should_invoke_it
ArgumentError:
wrong number of arguments (given 2, expected 1)
# /tmp/d20170103-15620-iipm1l/solution.rb:116:in `method_missing'
# /tmp/d20170103-15620-iipm1l/spec.rb:571:in `block (3 levels) in <top (required)>'
# /tmp/d20170103-15620-iipm1l/solution.rb:3:in `instance_eval'
# /tmp/d20170103-15620-iipm1l/solution.rb:3:in `totally_recall'
# /tmp/d20170103-15620-iipm1l/spec.rb:556:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:7:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:7:in `block (2 levels) in <top (required)>'
7) ArnoldCPM can return functions
Failure/Error: get_your_ass_to_mars _forty_two_printer
ArgumentError:
wrong number of arguments (given 2, expected 1)
# /tmp/d20170103-15620-iipm1l/solution.rb:116:in `method_missing'
# /tmp/d20170103-15620-iipm1l/spec.rb:605:in `block (3 levels) in <top (required)>'
# /tmp/d20170103-15620-iipm1l/solution.rb:3:in `instance_eval'
# /tmp/d20170103-15620-iipm1l/solution.rb:3:in `totally_recall'
# /tmp/d20170103-15620-iipm1l/spec.rb:593:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:7:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:7:in `block (2 levels) in <top (required)>'
8) ArnoldCPM defines new inner functions for each function invocation
Failure/Error: get_your_ass_to_mars _first_invocation
ArgumentError:
wrong number of arguments (given 2, expected 1)
# /tmp/d20170103-15620-iipm1l/solution.rb:116:in `method_missing'
# /tmp/d20170103-15620-iipm1l/spec.rb:635:in `block (3 levels) in <top (required)>'
# /tmp/d20170103-15620-iipm1l/solution.rb:3:in `instance_eval'
# /tmp/d20170103-15620-iipm1l/solution.rb:3:in `totally_recall'
# /tmp/d20170103-15620-iipm1l/spec.rb:625:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:7:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:7:in `block (2 levels) in <top (required)>'
9) ArnoldCPM supports basic recursion
Failure/Error: get_up 1
NoMethodError:
undefined method `+' for :_from:Symbol
# /tmp/d20170103-15620-iipm1l/solution.rb:15:in `get_up'
# /tmp/d20170103-15620-iipm1l/spec.rb:674:in `block (3 levels) in <top (required)>'
# /tmp/d20170103-15620-iipm1l/solution.rb:3:in `instance_eval'
# /tmp/d20170103-15620-iipm1l/solution.rb:3:in `totally_recall'
# /tmp/d20170103-15620-iipm1l/spec.rb:666:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:7:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:7:in `block (2 levels) in <top (required)>'
10) ArnoldCPM can calculate fibonacci(20) recursively
Failure/Error: let_off_some_steam_bennet _n
ArgumentError:
comparison of Fixnum with :_n failed
# /tmp/d20170103-15620-iipm1l/solution.rb:68:in `>'
# /tmp/d20170103-15620-iipm1l/solution.rb:68:in `let_off_some_steam_bennet'
# /tmp/d20170103-15620-iipm1l/spec.rb:720:in `block (3 levels) in <top (required)>'
# /tmp/d20170103-15620-iipm1l/solution.rb:3:in `instance_eval'
# /tmp/d20170103-15620-iipm1l/solution.rb:3:in `totally_recall'
# /tmp/d20170103-15620-iipm1l/spec.rb:714:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:7:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:7:in `block (2 levels) in <top (required)>'
11) ArnoldCPM can use closures in very convoluted ways
Failure/Error: get_your_ass_to_mars _result
ArgumentError:
wrong number of arguments (given 2, expected 1)
# /tmp/d20170103-15620-iipm1l/solution.rb:116:in `method_missing'
# /tmp/d20170103-15620-iipm1l/spec.rb:776:in `block (3 levels) in <top (required)>'
# /tmp/d20170103-15620-iipm1l/solution.rb:3:in `instance_eval'
# /tmp/d20170103-15620-iipm1l/solution.rb:3:in `totally_recall'
# /tmp/d20170103-15620-iipm1l/spec.rb:765:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:7:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:7:in `block (2 levels) in <top (required)>'
12) ArnoldCPM has algebra that can sum numbers
Failure/Error: expect(printer).to receive(:print).with(value_to_be_printed).ordered
(Double "printer").print(8)
expected: 1 time with arguments: (8)
received: 0 times with arguments: (8)
# /tmp/d20170103-15620-iipm1l/spec.rb:878:in `block in expect_execution'
# ./lib/language/ruby/run_with_timeout.rb:7:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:7:in `block (2 levels) in <top (required)>'
13) ArnoldCPM has algebra that can subtract numbers
Failure/Error: expect(printer).to receive(:print).with(value_to_be_printed).ordered
(Double "printer").print(3)
expected: 1 time with arguments: (3)
received: 0 times with arguments: (3)
# /tmp/d20170103-15620-iipm1l/spec.rb:878:in `block in expect_execution'
# ./lib/language/ruby/run_with_timeout.rb:7:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:7:in `block (2 levels) in <top (required)>'
14) ArnoldCPM has algebra that can multiply numbers
Failure/Error: expect(printer).to receive(:print).with(value_to_be_printed).ordered
(Double "printer").print(10)
expected: 1 time with arguments: (10)
received: 0 times with arguments: (10)
# /tmp/d20170103-15620-iipm1l/spec.rb:878:in `block in expect_execution'
# ./lib/language/ruby/run_with_timeout.rb:7:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:7:in `block (2 levels) in <top (required)>'
15) ArnoldCPM has algebra that can divide numbers
Failure/Error: expect(printer).to receive(:print).with(value_to_be_printed).ordered
(Double "printer").print(2)
expected: 1 time with arguments: (2)
received: 0 times with arguments: (2)
# /tmp/d20170103-15620-iipm1l/spec.rb:878:in `block in expect_execution'
# ./lib/language/ruby/run_with_timeout.rb:7:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:7:in `block (2 levels) in <top (required)>'
16) ArnoldCPM has algebra that can calculate modulo
Failure/Error: expect(printer).to receive(:print).with(value_to_be_printed).ordered
(Double "printer").print(2)
expected: 1 time with arguments: (2)
received: 0 times with arguments: (2)
# /tmp/d20170103-15620-iipm1l/spec.rb:878:in `block in expect_execution'
# ./lib/language/ruby/run_with_timeout.rb:7:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:7:in `block (2 levels) in <top (required)>'
17) ArnoldCPM has algebra that can chain multiple operations
Failure/Error: expect(printer).to receive(:print).with(value_to_be_printed).ordered
(Double "printer").print(42)
expected: 1 time with arguments: (42)
received: 0 times with arguments: (42)
# /tmp/d20170103-15620-iipm1l/spec.rb:878:in `block in expect_execution'
# ./lib/language/ruby/run_with_timeout.rb:7:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:7:in `block (2 levels) in <top (required)>'
18) ArnoldCPM has algebra that can use variables in calculations
Failure/Error: expect(printer).to receive(:print).with(value_to_be_printed).ordered
(Double "printer").print(21)
expected: 1 time with arguments: (21)
received: 0 times with arguments: (21)
# /tmp/d20170103-15620-iipm1l/spec.rb:878:in `block in expect_execution'
# ./lib/language/ruby/run_with_timeout.rb:7:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:7:in `block (2 levels) in <top (required)>'
19) ArnoldCPM has boolean arithmetic that given *or* returns truthy values if one of the operands is truthy
Failure/Error: expect(printer).to receive(:print).with(value_to_be_printed).ordered
(Double "printer").print(1)
expected: 1 time with arguments: (1)
received: 0 times with arguments: (1)
# /tmp/d20170103-15620-iipm1l/spec.rb:878:in `block in expect_execution'
# ./lib/language/ruby/run_with_timeout.rb:7:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:7:in `block (2 levels) in <top (required)>'
20) ArnoldCPM has boolean arithmetic that given *or* returns falsy values if both operands are falsy
Failure/Error: expect(printer).to receive(:print).with(value_to_be_printed).ordered
(Double "printer").print(0)
expected: 1 time with arguments: (0)
received: 0 times with arguments: (0)
# /tmp/d20170103-15620-iipm1l/spec.rb:878:in `block in expect_execution'
# ./lib/language/ruby/run_with_timeout.rb:7:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:7:in `block (2 levels) in <top (required)>'
21) ArnoldCPM has boolean arithmetic that given *or* between two truthy values returns the first one
Failure/Error: expect(printer).to receive(:print).with(value_to_be_printed).ordered
(Double "printer").print(11)
expected: 1 time with arguments: (11)
received: 0 times with arguments: (11)
# /tmp/d20170103-15620-iipm1l/spec.rb:878:in `block in expect_execution'
# ./lib/language/ruby/run_with_timeout.rb:7:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:7:in `block (2 levels) in <top (required)>'
22) ArnoldCPM has boolean arithmetic that given *and* returns falsy values if either operand is falsy
Failure/Error: expect(printer).to receive(:print).with(value_to_be_printed).ordered
(Double "printer").print(0)
expected: 1 time with arguments: (0)
received: 0 times with arguments: (0)
# /tmp/d20170103-15620-iipm1l/spec.rb:878:in `block in expect_execution'
# ./lib/language/ruby/run_with_timeout.rb:7:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:7:in `block (2 levels) in <top (required)>'
23) ArnoldCPM has boolean arithmetic that given *and* between two truthy values returns the second one
Failure/Error: expect(printer).to receive(:print).with(value_to_be_printed).ordered
(Double "printer").print(22)
expected: 1 time with arguments: (22)
received: 0 times with arguments: (22)
# /tmp/d20170103-15620-iipm1l/spec.rb:878:in `block in expect_execution'
# ./lib/language/ruby/run_with_timeout.rb:7:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:7:in `block (2 levels) in <top (required)>'
24) ArnoldCPM has boolean arithmetic that has the same precedence of *or* and *and* operations
Failure/Error: expect(printer).to receive(:print).with(value_to_be_printed).ordered
(Double "printer").print(0)
expected: 1 time with arguments: (0)
received: 0 times with arguments: (0)
# /tmp/d20170103-15620-iipm1l/spec.rb:878:in `block in expect_execution'
# ./lib/language/ruby/run_with_timeout.rb:7:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:7:in `block (2 levels) in <top (required)>'
25) ArnoldCPM has branching mechanism that can execute if statements
Failure/Error: because_im_going_to_say_please no_problemo
ArgumentError:
wrong number of arguments (given 2, expected 1)
# /tmp/d20170103-15620-iipm1l/solution.rb:116:in `method_missing'
# /tmp/d20170103-15620-iipm1l/spec.rb:336:in `block (4 levels) in <top (required)>'
# /tmp/d20170103-15620-iipm1l/solution.rb:3:in `instance_eval'
# /tmp/d20170103-15620-iipm1l/solution.rb:3:in `totally_recall'
# /tmp/d20170103-15620-iipm1l/spec.rb:334:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:7:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:7:in `block (2 levels) in <top (required)>'
26) ArnoldCPM has branching mechanism that can execute if-else statements
Failure/Error: because_im_going_to_say_please no_problemo
ArgumentError:
wrong number of arguments (given 2, expected 1)
# /tmp/d20170103-15620-iipm1l/solution.rb:116:in `method_missing'
# /tmp/d20170103-15620-iipm1l/spec.rb:363:in `block (4 levels) in <top (required)>'
# /tmp/d20170103-15620-iipm1l/solution.rb:3:in `instance_eval'
# /tmp/d20170103-15620-iipm1l/solution.rb:3:in `totally_recall'
# /tmp/d20170103-15620-iipm1l/spec.rb:361:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:7:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:7:in `block (2 levels) in <top (required)>'
27) ArnoldCPM has branching mechanism that can nest if-else statements
Failure/Error: because_im_going_to_say_please no_problemo
ArgumentError:
wrong number of arguments (given 2, expected 1)
# /tmp/d20170103-15620-iipm1l/solution.rb:116:in `method_missing'
# /tmp/d20170103-15620-iipm1l/spec.rb:410:in `block (4 levels) in <top (required)>'
# /tmp/d20170103-15620-iipm1l/solution.rb:3:in `instance_eval'
# /tmp/d20170103-15620-iipm1l/solution.rb:3:in `totally_recall'
# /tmp/d20170103-15620-iipm1l/spec.rb:408:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:7:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:7:in `block (2 levels) in <top (required)>'
28) ArnoldCPM has branching mechanism that considers functions truthy
Failure/Error: because_im_going_to_say_please _function
ArgumentError:
wrong number of arguments (given 2, expected 1)
# /tmp/d20170103-15620-iipm1l/solution.rb:116:in `method_missing'
# /tmp/d20170103-15620-iipm1l/spec.rb:456:in `block (4 levels) in <top (required)>'
# /tmp/d20170103-15620-iipm1l/solution.rb:3:in `instance_eval'
# /tmp/d20170103-15620-iipm1l/solution.rb:3:in `totally_recall'
# /tmp/d20170103-15620-iipm1l/spec.rb:451:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:7:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:7:in `block (2 levels) in <top (required)>'
Finished in 0.03083 seconds
29 examples, 28 failures
Failed examples:
rspec /tmp/d20170103-15620-iipm1l/spec.rb:15 # ArnoldCPM has true and false constants
rspec /tmp/d20170103-15620-iipm1l/spec.rb:28 # ArnoldCPM can assign variables
rspec /tmp/d20170103-15620-iipm1l/spec.rb:466 # ArnoldCPM can define and call functions with arguments
rspec /tmp/d20170103-15620-iipm1l/spec.rb:489 # ArnoldCPM can define and call functions with return value
rspec /tmp/d20170103-15620-iipm1l/spec.rb:517 # ArnoldCPM returns 0 by default
rspec /tmp/d20170103-15620-iipm1l/spec.rb:540 # ArnoldCPM can take functions as arguments
rspec /tmp/d20170103-15620-iipm1l/spec.rb:583 # ArnoldCPM can return functions
rspec /tmp/d20170103-15620-iipm1l/spec.rb:613 # ArnoldCPM defines new inner functions for each function invocation
rspec /tmp/d20170103-15620-iipm1l/spec.rb:651 # ArnoldCPM supports basic recursion
rspec /tmp/d20170103-15620-iipm1l/spec.rb:695 # ArnoldCPM can calculate fibonacci(20) recursively
rspec /tmp/d20170103-15620-iipm1l/spec.rb:760 # ArnoldCPM can use closures in very convoluted ways
rspec /tmp/d20170103-15620-iipm1l/spec.rb:45 # ArnoldCPM has algebra that can sum numbers
rspec /tmp/d20170103-15620-iipm1l/spec.rb:62 # ArnoldCPM has algebra that can subtract numbers
rspec /tmp/d20170103-15620-iipm1l/spec.rb:79 # ArnoldCPM has algebra that can multiply numbers
rspec /tmp/d20170103-15620-iipm1l/spec.rb:96 # ArnoldCPM has algebra that can divide numbers
rspec /tmp/d20170103-15620-iipm1l/spec.rb:113 # ArnoldCPM has algebra that can calculate modulo
rspec /tmp/d20170103-15620-iipm1l/spec.rb:130 # ArnoldCPM has algebra that can chain multiple operations
rspec /tmp/d20170103-15620-iipm1l/spec.rb:154 # ArnoldCPM has algebra that can use variables in calculations
rspec /tmp/d20170103-15620-iipm1l/spec.rb:183 # ArnoldCPM has boolean arithmetic that given *or* returns truthy values if one of the operands is truthy
rspec /tmp/d20170103-15620-iipm1l/spec.rb:218 # ArnoldCPM has boolean arithmetic that given *or* returns falsy values if both operands are falsy
rspec /tmp/d20170103-15620-iipm1l/spec.rb:235 # ArnoldCPM has boolean arithmetic that given *or* between two truthy values returns the first one
rspec /tmp/d20170103-15620-iipm1l/spec.rb:252 # ArnoldCPM has boolean arithmetic that given *and* returns falsy values if either operand is falsy
rspec /tmp/d20170103-15620-iipm1l/spec.rb:287 # ArnoldCPM has boolean arithmetic that given *and* between two truthy values returns the second one
rspec /tmp/d20170103-15620-iipm1l/spec.rb:304 # ArnoldCPM has boolean arithmetic that has the same precedence of *or* and *and* operations
rspec /tmp/d20170103-15620-iipm1l/spec.rb:324 # ArnoldCPM has branching mechanism that can execute if statements
rspec /tmp/d20170103-15620-iipm1l/spec.rb:347 # ArnoldCPM has branching mechanism that can execute if-else statements
rspec /tmp/d20170103-15620-iipm1l/spec.rb:378 # ArnoldCPM has branching mechanism that can nest if-else statements
rspec /tmp/d20170103-15620-iipm1l/spec.rb:441 # ArnoldCPM has branching mechanism that considers functions truthy
История (1 версия и 1 коментар)
Георги обнови решението на 29.12.2016 18:21 (преди почти 8 години)