Решение на Шахматни фенове от Божидар Горанов
Обратно към всички решения
Към профила на Божидар Горанов
Резултати
- 3 точки от тестове
- 0 бонус точки
- 3 точки общо
- 5 успешни тест(а)
- 12 неуспешни тест(а)
Код
Лог от изпълнението
.EEEEEEEEE.FEF...
======================================================================
ERROR: test_against_touching_kings (test.TestChessPosition)
Test for kings next to each other.
----------------------------------------------------------------------
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
IndexError: string index out of range
======================================================================
ERROR: test_black_is_winning (test.TestChessPosition)
Test black_is_winning.
----------------------------------------------------------------------
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
IndexError: string index out of range
======================================================================
ERROR: test_get_black_score (test.TestChessPosition)
Test get_black_score.
----------------------------------------------------------------------
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
IndexError: string index out of range
======================================================================
ERROR: test_get_white_score (test.TestChessPosition)
Test get_white_score.
----------------------------------------------------------------------
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
IndexError: string index out of range
======================================================================
ERROR: test_getitem (test.TestChessPosition)
Test getitem functionality.
----------------------------------------------------------------------
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
IndexError: string index out of range
======================================================================
ERROR: test_is_equal (test.TestChessPosition)
Test is_equal.
----------------------------------------------------------------------
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
IndexError: string index out of range
======================================================================
ERROR: test_king_count (test.TestChessPosition)
Test for missing or multiple kings.
----------------------------------------------------------------------
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
IndexError: string index out of range
======================================================================
ERROR: test_len (test.TestChessPosition)
Test number of pieces for a position.
----------------------------------------------------------------------
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
solution.KingException: kings
======================================================================
ERROR: test_pawns_position (test.TestChessPosition)
Test for incorrect pawns.
----------------------------------------------------------------------
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
IndexError: string index out of range
======================================================================
ERROR: test_white_is_winning (test.TestChessPosition)
Test white_is_winning.
----------------------------------------------------------------------
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
IndexError: string index out of range
======================================================================
FAIL: test_validation_conflict (test.TestChessPosition)
Test for correct Exception on multiple validation fails.
----------------------------------------------------------------------
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: 'pawns' != 'kings'
- pawns
+ kings
======================================================================
FAIL: test_basic_arithmetic (test.TestChessScore)
Test additiona and subtraction of ChessScores.
----------------------------------------------------------------------
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: None != 7
----------------------------------------------------------------------
Ran 17 tests in 0.169s
FAILED (failures=2, errors=10)
История (3 версии и 4 коментара)
Божидар обнови решението на 26.11.2022 19:07 (преди почти 2 години)
Божидар обнови решението на 27.11.2022 16:29 (преди почти 2 години)
Божидар обнови решението на 28.11.2022 14:37 (преди почти 2 години)
По-добре раздели цялата тази логика на отделни методи - парсване, валидиране на царе, валидиране на пешки.. Всеки метод трябва да изпълнява само едно (възможно най-малко) нещо, за да можеш лесно да тестваш в последствие.