Решение на Морски шах от Рейхан Садък
Обратно към всички решения
Към профила на Рейхан Садък
Резултати
- 2 точки от тестове
- 0 бонус точки
- 2 точки общо
- 2 успешни тест(а)
- 6 неуспешни тест(а)
Код
Лог от изпълнението
FFF
Stdout:
Invalid Value Exception
.F
Stdout:
Not Your Turn Exception
FF.
======================================================================
FAIL: 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-14erx7b/test.py", line 144, in test_draw
self.assertEqual('Draw!', d.game_status())
AssertionError: 'Draw!' != 'X wins!'
- Draw!
+ X wins!
======================================================================
FAIL: 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-14erx7b/test.py", line 151, in test_game_in_progress
self.assertEqual('Game in progress.', p.game_status())
AssertionError: 'Game in progress.' != 'In progress!'
- Game in progress.
+ In progress!
======================================================================
FAIL: 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-14erx7b/test.py", line 54, in test_input_format
o['A3'] = 'G'
AssertionError: InvalidValue not raised
Stdout:
Invalid Value Exception
======================================================================
FAIL: 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-14erx7b/test.py", line 68, in test_overwrite_move
o["A2"] = 'X'
AssertionError: NotYourTurn not raised
Stdout:
Not Your Turn Exception
======================================================================
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-14erx7b/test.py", line 17, in test_tostring_empty
self.assertEqual(empty_board, b.__str__())
AssertionError: '\n -------------\n3 | | | |\n -------------\n2 | | | |\n ------- [truncated]... != '\n -------------\n3 | | | |\n2 | | | |\n1 | | | |\n ------- [truncated]...
-------------
3 | | | |
- -------------
2 | | | |
- -------------
1 | | | |
-------------
A B C
======================================================================
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-14erx7b/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 -------------\n3 | O | O | X |\n2 | X | X | O |\n1 | O | X | O |\n ------- [truncated]...
-------------
3 | O | O | X |
- -------------
2 | X | X | O |
- -------------
1 | O | X | O |
-------------
A B C
----------------------------------------------------------------------
Ran 8 tests in 0.086s
FAILED (failures=6)
История (1 версия и 1 коментар)
Рейхан обнови решението на 15.04.2013 00:32 (преди над 11 години)