Refactor
Summary: This merge request refactors the 2048 game project to separate game logic from display functionality, improving modularity and maintainability. The jeu.py file now only contains the core game loop and grid manipulation, while main.py manages the game display using an external call to display_game_state after each move. This allows easier testing and future modifications for the display or input handling.
Changes:
Refactored jeu.py: Moved the game display functionality to display_game_state, which is now externally callable. Updated jeu() to yield the game state after each valid move, allowing the game loop to be controlled externally. New main.py: main.py now handles the display of the game grid by calling display_game_state with each new game state provided by jeu(). Provides a clear separation of responsibilities, with main.py focusing on display and jeu.py focusing on game mechanics. Improved Game Loop: Simplified the game loop to yield the game state after each move, making it more adaptable for various user interfaces or automated testing.