Решение на От ливадите до Лас Вегас (и назад) от Никол Казанджиева
Обратно към всички решения
Към профила на Никол Казанджиева
Резултати
- 5 точки от тестове
- 0 бонус точки
- 5 точки общо
- 7 успешни тест(а)
- 8 неуспешни тест(а)
Код
Лог от изпълнението
EE...EE..EE..EE
======================================================================
ERROR: test_correct_deck_init (test.TestBelot)
Test initialization with correct deck.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/storage/deedee/data/rails/pyfmi-2022/releases/20221115154139/lib/language/python/runner.py", line 67, in thread
raise result
AttributeError: 'tuple' object has no attribute 'get_suit'
======================================================================
ERROR: test_correct_direction_and_players_deal (test.TestBelot)
Test dealing with correct direction and players.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/storage/deedee/data/rails/pyfmi-2022/releases/20221115154139/lib/language/python/runner.py", line 67, in thread
raise result
AttributeError: 'tuple' object has no attribute 'get_suit'
======================================================================
ERROR: test_init_filtered (test.TestDeck)
Test initialized cards with filter.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/storage/deedee/data/rails/pyfmi-2022/releases/20221115154139/lib/language/python/runner.py", line 67, in thread
raise result
AttributeError: 'tuple' object has no attribute 'get_suit'
======================================================================
ERROR: test_init_regular (test.TestDeck)
Test initialized cards without filter.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/storage/deedee/data/rails/pyfmi-2022/releases/20221115154139/lib/language/python/runner.py", line 67, in thread
raise result
AttributeError: 'tuple' object has no attribute 'get_suit'
======================================================================
ERROR: test_dealing_ltr (test.TestGame)
Test dealing the cards left to right.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/storage/deedee/data/rails/pyfmi-2022/releases/20221115154139/lib/language/python/runner.py", line 67, in thread
raise result
AttributeError: 'tuple' object has no attribute 'get_suit'
======================================================================
ERROR: test_dealing_rtl (test.TestGame)
Test dealing the cards right to left.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/storage/deedee/data/rails/pyfmi-2022/releases/20221115154139/lib/language/python/runner.py", line 67, in thread
raise result
AttributeError: 'tuple' object has no attribute 'get_suit'
======================================================================
ERROR: test_correct_deck_init (test.TestPoker)
Test initialization with correct deck.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/storage/deedee/data/rails/pyfmi-2022/releases/20221115154139/lib/language/python/runner.py", line 67, in thread
raise result
AttributeError: 'tuple' object has no attribute 'get_suit'
======================================================================
ERROR: test_correct_direction_and_players_deal (test.TestPoker)
Test dealing with correct direction and players.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/storage/deedee/data/rails/pyfmi-2022/releases/20221115154139/lib/language/python/runner.py", line 67, in thread
raise result
AttributeError: 'tuple' object has no attribute 'get_suit'
----------------------------------------------------------------------
Ran 15 tests in 0.160s
FAILED (errors=8)
История (2 версии и 9 коментара)
Никол обнови решението на 14.11.2022 16:38 (преди около 2 години)
Никол обнови решението на 15.11.2022 13:48 (преди около 2 години)
Този клас никъде не го инстанцираш. Само дефиниция, но не се използва.
В контекста на клас
Player
, името на променливата е ненужно дълго.self.deck
ще носи също толкова информация, пък е по-кратко.Конструкцията тук е неудачна, защото трябва да кажеш
...deck.deck...
. Би било добре да имаш методи вDeck
, които да добавят карта, за да го избегнеш. Не е нужно да преправяш сега. Просто споделям мнение.Не е добра идея да променяш реда на играчите. Ако ти трябва да използваш друг ред, запази го в локална променлива, но не закачай вече установения ред.