Rubik's Cube
A downloadable program
This program is a personal project that displays and solves a Rubik's Cube. Before I started making this, I wondered if I could create an interactive 3D simulation only with Python and a few basic modules (Tkinter, Random, and Platform specifically). A month and 1500 lines of code later, I found the answer to be a resounding "yes!" The program is not built on a 3D platform; instead, every x, y, z coordinate is precisely calculated and mathematically projected onto your 2D screen. If you would like to download the program and test its functionality for yourself, be my guest! Additionally, if you would like to understand more about how it works, I have created another file with commentary detailing how it all comes together. To read the files online, please visit github.com/MaxDobbs32/Rubiks-Cube
Edit: I realized this program was tailored to my specific computer, which runs at a certain speed. If your computer is faster or slower, the animation won't look as smooth. Unfortunately, there doesn't seem to be a good way to fix this with Python.
Status | Released |
Category | Other |
Author | Maxine Dobbs |
Genre | Puzzle, Simulation |
Tags | 3D, artificial-intelligence |
Install instructions
Before installing or running the program, make sure you agree to the terms as found at https://github.com/MaxDobbs32/Rubiks-Cube/blob/master/LICENSE.md
There are several ways of running the file. The easiest method involves going to repl.it, but it has the lowest quality. Otherwise, you can download and run the file on your personal computer. If possible, running it with Python 3 on a computer will yield the best quality. Note that having a low battery may affect the speed of the program regardless of what method you use.
Option 1 (easier): Visit https://repl.it/@MaxDobbs32/Rubiks-Cube#main.py and click "Run"
Option 2 (faster and looks better):
1. Check if Python and Tkinter are installed. For Python, this can be done by typing "python --version" in your Command Prompt or Terminal application. If not, download and install it using the instructions at www.python.org. Tkinter might be harder, but I would think it should come prepackaged with Python. If not, this link has information: https://stackoverflow.com/questions/69603788/how-to-pip-install-tkinter
2. Download the Rubiks_Cube.py or Rubiks_Cube_with_Commentary.py file here or from https://github.com/MaxDobbs32/Rubiks-Cube
3. Open the Command Prompt app on Windows or the Terminal app on Mac (and many Linux systems). On Windows, it may also be sufficient to simply double-click the file and wait for the program to run. (If you see a document instead or no window opens, you should follow the steps below.)
4. Type or copy-paste "cd Downloads" or otherwise navigate to the parent directory and press enter. Then type "python Rubiks_Cube.py" and press enter.*
* If you have Python 3, you can type "python3" instead of "python" to ensure better graphics. If you only downloaded the file with commentary, write "Rubiks_Cube_with_Commentary.py" instead of "Rubiks_Cube.py".
Option 3: Use an IDE
1. Download an IDE for storing and running Python files. I personally use PyCharm.
2. Create a new project.
3. Move the file to this project. This step requires knowing or learning how your computer stores files.
4. Run the file. This will likely involve clicking a play button.
Leave a comment
Log in with itch.io to leave a comment.