Решение на От ливадите до Лас Вегас (и назад) от Мария Кукова
Обратно към всички решения
Към профила на Мария Кукова
Резултати
- 4 точки от тестове
- 0 бонус точки
- 4 точки общо
- 6 успешни тест(а)
- 9 неуспешни тест(а)
Код
Лог от изпълнението
FE....F.EEEE.FE
======================================================================
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
TypeError: sequence index must be integer, not 'slice'
======================================================================
ERROR: test_collecting_cards_before_dealing (test.TestGame)
Test collecting the cards before a new deal.
----------------------------------------------------------------------
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
TypeError: sequence index must be integer, not 'slice'
======================================================================
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
TypeError: sequence index must be integer, not 'slice'
======================================================================
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
TypeError: sequence index must be integer, not 'slice'
======================================================================
ERROR: test_players_creation (test.TestGame)
Test creation and retrieval of 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
TypeError: sequence index must be integer, not 'slice'
======================================================================
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
TypeError: sequence index must be integer, not 'slice'
======================================================================
FAIL: 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
AssertionError: Items in the first set but not the second:
('hearts', '10')
('spades', 'Q')
('diamonds', '10')
('hearts', 'Q')
('diamonds', 'Q')
('spades', 'K')
('spades', '10')
('spades', '7')
('hearts', 'K')
('hearts', '7')
('spades', 'A')
('clubs', '8')
('clubs', '9')
('diamonds', '7')
('diamonds', 'K')
('clubs', 'J')
('clubs', '10')
('hearts', 'A')
('diamonds', 'A')
('clubs', 'Q')
('clubs', 'K')
('spades', '9')
('clubs', '7')
('spades', 'J')
('spades', '8')
('hearts', 'J')
('hearts', '8')
('hearts', '9')
('clubs', 'A')
('diamonds', 'J')
('diamonds', '8')
('diamonds', '9')
======================================================================
FAIL: 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
AssertionError: Items in the first set but not the second:
('diamonds', '6')
('clubs', '4')
('clubs', '5')
('clubs', '3')
('spades', '2')
('hearts', '2')
('diamonds', '2')
('clubs', '6')
('spades', '4')
('spades', '5')
('spades', '3')
('hearts', '4')
('hearts', '3')
('hearts', '5')
('diamonds', '4')
('diamonds', '5')
('diamonds', '3')
('clubs', '2')
('spades', '6')
('hearts', '6')
======================================================================
FAIL: 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
AssertionError: Items in the first set but not the second:
('diamonds', '6')
('clubs', '4')
('hearts', '10')
('clubs', '5')
('spades', 'Q')
('diamonds', '10')
('clubs', '3')
('hearts', 'Q')
('spades', '2')
('diamonds', 'Q')
('spades', 'K')
('spades', '10')
('spades', '7')
('hearts', 'K')
('hearts', '2')
('hearts', '7')
('spades', 'A')
('diamonds', '2')
('clubs', '8')
('clubs', '9')
('diamonds', '7')
('clubs', '6')
('diamonds', 'K')
('spades', '4')
('clubs', 'J')
('clubs', '10')
('hearts', 'A')
('hearts', '4')
('spades', '3')
('spades', '5')
('diamonds', 'A')
('hearts', '3')
('hearts', '5')
('clubs', 'Q')
('diamonds', '4')
('diamonds', '5')
('diamonds', '3')
('clubs', '2')
('clubs', 'K')
('hearts', '6')
('clubs', '7')
('spades', '6')
('spades', '9')
('spades', 'J')
('spades', '8')
('hearts', 'J')
('hearts', '8')
('hearts', '9')
('clubs', 'A')
('diamonds', 'J')
('diamonds', '8')
('diamonds', '9')
----------------------------------------------------------------------
Ran 15 tests in 0.174s
FAILED (failures=3, errors=6)
История (1 версия и 6 коментара)
Мария обнови решението на 15.11.2022 15:05 (преди около 2 години)
Тестето по подразбиране трябва да има 52 карти, а не 32, като за Белот.
Грешно си интерпретирала инструкциите. Този метод се използва за да видим какви ирачи имаш, а не за да ги инициализираш. Играчите трябва да се инициализират още при инициализиране на класа. Този метод просто ни ги показва, но и без него трябва да можеш да работиш с класа.
Ако използваш
for
, ще си спестиш ръчното инкрементиране на брояча.Убеди се, че връщаш данните в правилния тип. Иначе тестовете ще гръмнат.
Тук не си имплементирала събирането на карти от играчите. Виждам, че по-долу се дефинирала ново тесте при конкретните игри, което до известна степен се справя с проблема, но идеологически погледнато, ако седнеш да играеш карти, не вадиш ново тесте на всяко раздаване. Не гарантирам, че всички тестове ще минат при тази имплементация.