Решение на Морски шах от Александър Тахчиев

Обратно към всички решения

Към профила на Александър Тахчиев

Резултати

  • 0 точки от тестове
  • 0 бонус точки
  • 0 точки общо
  • 0 успешни тест(а)
  • 0 неуспешни тест(а)

Код

class TicTacToeBoard:
def __init__(self):
self._board = {'A1': ' ', 'A2': ' ', 'A3': ' ',
'B1': ' ', 'B2': ' ', 'B3': ' ',
'C1': ' ', 'C2': ' ', 'C3': ' '}
def __str__(self):
line = ' -------------'
return '\n' + line + '\n' +\
+ ('\n' + line + '\n').join([str(row) + ' | ' +
' | '.join(
[self._board[column + str(row)]
for column in 'ABC']) + ' |'
for row in [3,2,1]]) + '\n' + line +\
'\n A B C'
def __setitem__(self, key, val):
self._board[key] = val
def first_exceptions(key, val):
try:
'''WAAAAAAAAAAAAA'''
return
def game_status():
return 'Game in progress.'

Лог от изпълнението

File "lib/language/python/runner.py", line 99, in main
    test = imp.load_source('test', test_module)
  File "/opt/python3.3/lib/python3.3/imp.py", line 109, in load_source
    return _LoadSourceCompatibility(name, pathname, file).load_module(name)
  File "<frozen importlib._bootstrap>", line 586, in _check_name_wrapper
  File "<frozen importlib._bootstrap>", line 1023, in load_module
  File "<frozen importlib._bootstrap>", line 1004, in load_module
  File "<frozen importlib._bootstrap>", line 562, in module_for_loader_wrapper
  File "<frozen importlib._bootstrap>", line 869, in _load_module
  File "<frozen importlib._bootstrap>", line 313, in _call_with_frames_removed
  File "/tmp/d20130415-29081-tavyb/test.py", line 2, in <module>
    import solution

История (1 версия и 0 коментара)

Александър обнови решението на 15.04.2013 16:48 (преди над 11 години)

+class TicTacToeBoard:
+
+ def __init__(self):
+ self._board = {'A1': ' ', 'A2': ' ', 'A3': ' ',
+ 'B1': ' ', 'B2': ' ', 'B3': ' ',
+ 'C1': ' ', 'C2': ' ', 'C3': ' '}
+
+ def __str__(self):
+ line = ' -------------'
+ return '\n' + line + '\n' +\
+ + ('\n' + line + '\n').join([str(row) + ' | ' +
+ ' | '.join(
+ [self._board[column + str(row)]
+ for column in 'ABC']) + ' |'
+ for row in [3,2,1]]) + '\n' + line +\
+ '\n A B C'
+
+ def __setitem__(self, key, val):
+ self._board[key] = val
+
+ def first_exceptions(key, val):
+ try:
+ '''WAAAAAAAAAAAAA'''
+ return
+
+ def game_status():
+ return 'Game in progress.'