Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generalize yishu/topspingui #86

Open
Ant1ng2 opened this issue Jan 18, 2021 · 0 comments
Open

Generalize yishu/topspingui #86

Ant1ng2 opened this issue Jan 18, 2021 · 0 comments
Labels
help wanted Extra attention is needed Player Issues referring to Player

Comments

@Ant1ng2
Copy link
Contributor

Ant1ng2 commented Jan 18, 2021

Background

The branch yishu/TopSpinGUI, also #73, is part of a project made by one of the previous semester's students. The code can be activated through the following: Note: If you're using WSL, you'll need an X Server installation as this is a graphical program

# Run from base directory
python3 -m puzzlesolver.GUI.topspin_gui

You should see a GUI with TopSpin, a puzzle that involves rotating a circle of numbers and switching the positions of two numbers at set indices. The goal of the game is to put the numbers in order from smallest to largest (no end point specified).

However, this implementation has a few flaws.

  • The GUI is more of a draft implementation and a demo of the functionality of the tkinter module
  • This only works on the TopSpin Puzzle
    While it is an impressive work, we wish to generalize this functionality to provide a GUI for all puzzles, not just TopSpin.

Suggested Workflow:

  • Design an abstract base class (ABC) that inherits from the Puzzle base class (similar to a ServerPuzzle). This is recommended if there is functionality outside of a Puzzle class that is required to run a GUI. Example naming: GUIPuzzle
  • Take an example puzzle and let it inherit the GUIPuzzle base class. Define the functions defined in GUIPuzzle.
  • Implement the GUI class that takes in an instance of a GUIPuzzle and an instance of a Solver. When play is called on this class, displays a tkinter interface with a Puzzle functionality.

Expected API:

from puzzlesolver.players import GUI
GUI(puzzle, solver=None, **kwds).play()
@Ant1ng2 Ant1ng2 changed the title Incorporate puzzlesolver.players package Generalize yishu/topspingui Jan 22, 2021
@Ant1ng2 Ant1ng2 added Player Issues referring to Player help wanted Extra attention is needed labels Jan 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed Player Issues referring to Player
Projects
None yet
Development

No branches or pull requests

1 participant