Решение на Морски шах от Димитър Станев
Обратно към всички решения
Към профила на Димитър Станев
Резултати
- 0 точки от тестове
- 0 бонус точки
- 0 точки общо
- 0 успешни тест(а)
- 8 неуспешни тест(а)
Код
Лог от изпълнението
E
Stdout:
NEW GAME STARTED !
E
Stdout:
NEW GAME STARTED !
E
Stdout:
NEW GAME STARTED !
E
Stdout:
NEW GAME STARTED !
E
Stdout:
NEW GAME STARTED !
F
Stdout:
NEW GAME STARTED !
F
Stdout:
NEW GAME STARTED !
E
Stdout:
NEW GAME STARTED !
======================================================================
ERROR: test_draw (test.TicTacHomeworkTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "lib/language/python/runner.py", line 60, in thread
raise it.exc_info[1]
File "lib/language/python/runner.py", line 48, in run
self.result = func(*args, **kwargs)
File "/tmp/d20130415-29081-1e79zsg/test.py", line 144, in test_draw
self.assertEqual('Draw!', d.game_status())
File "/tmp/d20130415-29081-1e79zsg/solution.py", line 40, in game_status
if matrix[i][0] == matrix[i][1] and matrix[i][0] == matrix[i][2]:
NameError: global name 'matrix' is not defined
Stdout:
NEW GAME STARTED !
======================================================================
ERROR: test_game_in_progress (test.TicTacHomeworkTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "lib/language/python/runner.py", line 60, in thread
raise it.exc_info[1]
File "lib/language/python/runner.py", line 48, in run
self.result = func(*args, **kwargs)
File "/tmp/d20130415-29081-1e79zsg/test.py", line 151, in test_game_in_progress
self.assertEqual('Game in progress.', p.game_status())
File "/tmp/d20130415-29081-1e79zsg/solution.py", line 40, in game_status
if matrix[i][0] == matrix[i][1] and matrix[i][0] == matrix[i][2]:
NameError: global name 'matrix' is not defined
Stdout:
NEW GAME STARTED !
======================================================================
ERROR: test_input_format (test.TicTacHomeworkTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "lib/language/python/runner.py", line 60, in thread
raise it.exc_info[1]
File "lib/language/python/runner.py", line 48, in run
self.result = func(*args, **kwargs)
File "/tmp/d20130415-29081-1e79zsg/test.py", line 44, in test_input_format
with self.assertRaises(solution.InvalidKey):
AttributeError: 'module' object has no attribute 'InvalidKey'
Stdout:
NEW GAME STARTED !
======================================================================
ERROR: test_o_wins (test.TicTacHomeworkTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "lib/language/python/runner.py", line 60, in thread
raise it.exc_info[1]
File "lib/language/python/runner.py", line 48, in run
self.result = func(*args, **kwargs)
File "/tmp/d20130415-29081-1e79zsg/test.py", line 110, in test_o_wins
self.assertEqual('O wins!', h.game_status())
File "/tmp/d20130415-29081-1e79zsg/solution.py", line 40, in game_status
if matrix[i][0] == matrix[i][1] and matrix[i][0] == matrix[i][2]:
NameError: global name 'matrix' is not defined
Stdout:
NEW GAME STARTED !
======================================================================
ERROR: test_overwrite_move (test.TicTacHomeworkTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "lib/language/python/runner.py", line 60, in thread
raise it.exc_info[1]
File "lib/language/python/runner.py", line 48, in run
self.result = func(*args, **kwargs)
File "/tmp/d20130415-29081-1e79zsg/test.py", line 64, in test_overwrite_move
with self.assertRaises(solution.NotYourTurn):
AttributeError: 'module' object has no attribute 'NotYourTurn'
Stdout:
NEW GAME STARTED !
======================================================================
ERROR: test_x_wins (test.TicTacHomeworkTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "lib/language/python/runner.py", line 60, in thread
raise it.exc_info[1]
File "lib/language/python/runner.py", line 48, in run
self.result = func(*args, **kwargs)
File "/tmp/d20130415-29081-1e79zsg/test.py", line 79, in test_x_wins
self.assertEqual('X wins!', h.game_status())
File "/tmp/d20130415-29081-1e79zsg/solution.py", line 40, in game_status
if matrix[i][0] == matrix[i][1] and matrix[i][0] == matrix[i][2]:
NameError: global name 'matrix' is not defined
Stdout:
NEW GAME STARTED !
======================================================================
FAIL: test_tostring_empty (test.TicTacHomeworkTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "lib/language/python/runner.py", line 60, in thread
raise it.exc_info[1]
File "lib/language/python/runner.py", line 48, in run
self.result = func(*args, **kwargs)
File "/tmp/d20130415-29081-1e79zsg/test.py", line 17, in test_tostring_empty
self.assertEqual(empty_board, b.__str__())
AssertionError: '\n -------------\n3 | | | |\n -------------\n2 | | | |\n ------- [truncated]... != ' -------------\n'
-
-------------
- 3 | | | |
- -------------
- 2 | | | |
- -------------
- 1 | | | |
- -------------
- A B C
Stdout:
NEW GAME STARTED !
======================================================================
FAIL: test_tostring_full (test.TicTacHomeworkTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "lib/language/python/runner.py", line 60, in thread
raise it.exc_info[1]
File "lib/language/python/runner.py", line 48, in run
self.result = func(*args, **kwargs)
File "/tmp/d20130415-29081-1e79zsg/test.py", line 40, in test_tostring_full
self.assertEqual(full_board, d.__str__())
AssertionError: '\n -------------\n3 | O | O | X |\n -------------\n2 | X | X | O |\n ------- [truncated]... != ' -------------\n'
-
-------------
- 3 | O | O | X |
- -------------
- 2 | X | X | O |
- -------------
- 1 | O | X | O |
- -------------
- A B C
Stdout:
NEW GAME STARTED !
----------------------------------------------------------------------
Ran 8 tests in 0.010s
FAILED (failures=2, errors=6)
История (1 версия и 1 коментар)
Димитър обнови решението на 15.04.2013 15:24 (преди над 11 години)