Skip to content

Major release with huge optimizations

Latest
Compare
Choose a tag to compare
@a2ys a2ys released this 23 Apr 15:53
· 10 commits to master since this release

Summary

The program has been optimized to the heights of my capability, and has got many bugs squashed except for one mentioned in board.py file, which will soon be fixed in a following patch. I've temporarily disabled sounds, which will be reintroduced in a future release with some optimizations. Scheduled for another future release on my TODO list, I've kept a fully functional window to be implemented which can be used for customizing the graphics, importing custom FENs, saving a game, reporting a bug, checking for updates. Well this is a lot, and is in process of its making.

Major additions

  • The program now uses the set data type for storage of all types of data, which has played the major role in drastically improving the efficiency of the program.
  • The Move object has now been made hashable with the __hash()__ and __eq()__ methods implemented, to facilitate its usage with the set data type.
  • Enums have been created for every value which was repeatedly being used in the program, and also to increase the efficiency and make the program less prone to typos. The Enum values have been made integer values so as to increase the efficiency of dependent algorithms.
  • Game Modes have been added where you may choose to play against another person, against the AI as both WHITE and BLACK, or you may choose to let the AI create chaos by letting it play against itself and enjoy the show. :)
  • Tests have been made depth based, instead of manually writing every test for different depths. Now any person can test the program to any specified depth. (default is 5, fails onwards)

Minor additions

  • The game now uses predefined sets for checking special moves, facilitating efficient validation of moves.
  • The Piece.get_alpha() now returns a single char instead of a string of 2 characters, so as to increase readability as well as increasing the efficiency of comparison steps by a minor bit.
  • Created a new is_whitespace_under_attack() method to check for attacks on squares with no pieces.
  • match ... case blocks have been added for efficient comparison where the value to be compared is fixed.
  • The efficiency of special_moves() method has been improved by adding correct checks in the correct order, compared to the previous version of the method.
  • The main.py file has been edited to accommodate different game modes.

Bug fixes

  • A bug where the colors were not reset on double clicking on the same square has been fixed.

Remaining bugs and current halts

  • The production of appropriate sounds for different types of moves have been put to a halt, and will be implemented in the next patch or minor update.
  • The FEN k7/6p1/8/q4P1K/8/8/8/8 b KQkq - 0 1, and similar FENs with the same arrangement of the King, Queen and the pawns, allow the King to be captured due to a bug in validation of the En-passant move. This will be fixed in the next minor update or major update.
  • The tests fail at a depth of 5, logs of which can be found in the GitHub workflow runs.

Scheduled features for future releases

  • A logger for easy issue tracking, and quicker resolution.

  • A fully fledged window incorporating the following:

    • A way to import custom FENs;
    • Save the current game state in a file, and load it when necessary;
    • Change the game modes;
    • Tweak the colors of the game;
    • Enable/disable sounds;
    • Report bugs and issues and check for updates;

and many more ...

You may also contribute to the project to help facilitate quicker development, and help make new features accessible to everyone early on. Thanks for your time reading the update notes. :)