Play chess and listen to music
Listen to the extremely relaxing and very quiet "ode to joy" while playing chess. Try playing chess while the chorus starts screaming.
Uses regular (FIDE) notation works like this: piece and where the piece went
. For example:
- Pond from e2 to e4 is e4
- Queen to h5 Qh5
and so on! It now works, thanks for your support!
this project was done independently and works
I love this one! It's original and creative :)
After the first turn, it crashes if you give it an invalid command. This is because you have
try: chess_game() except: print(sys.exc_info()) chess_game()
chess_game() is only being error-checked once. This will be fixed if you change the
while loop at the end of
while True: # Instead of True, you can put a condition checking if the game has been won try: board=chess.Board(board.fen()) move(board) except ValueError: print(colored('Move not recognized!', 'red'))
Also, you in general shouldn't define functions within a function. Right now inside
def chess_game you include
def statements for
tie. You can put these function definitions outside of the
chess_game function definition and the code will work the same but with less chance for error and better speed and memory management.
Also, cool idea for using audio in a python project by embedding a repl within a repl. If only there were a way for the iframe to communicate with the webpage.
Didn't work for me, after second move it logs an error:
Traceback (most recent call last):
File "main.py", line 49, in <module>
File "main.py", line 41, in chess_game
File "main.py", line 27, in move
if board.turn == True:
AttributeError: 'Move' object has no attribute 'turn'