Orientation of the Last Layer Solver

The following is a breakdown of the first step of my python based Rubix Cube Solver, wherein it solves the upper most layer of the cube.

Tech Stack

Python

CustomTKinter

Pyinstaller

First Release

Description

This is v1.0.0 of OLLSolver. I plan to make multiple GUI updates as I implement the other layers in the future.

Purpose

The purpose of creating the Rubik's Cube solver was to develop a deeper understanding of Python. I started the project with no prior knowledge of Python and planned to use multiple libraries to expand my experience with the language.

The Process

I approached the idea from multiple angles but ultimately decided to use two matrices to define the squares and edges of the cube. I used CustomTkinter to create a grid of buttons, and then updated the value of each square when a button was pressed. This approach gave me thorough experience with Tkinter widgets and Python GUI development as a whole. Initially, I manually typed out each algorithm from memory, drawing on my prior knowledge of Rubik's Cubes. However, this method required an absurd amount of direct mapping of the cubes and edges, even for minor changes.

caption
After taking some time away from the project, I realized that using an algorithm to detect the rotation of the cube's face would save many lines of code and provide a more efficient approach. Instead of creating a new pattern for each "U" rotation, I implemented a variable that iterated each time the face rotated. Once I finalized the cube's logic, I began researching ways to package my code as an executable. After encountering multiple issues while learning the Windows terminal, I eventually gained a solid understanding of setting up virtual environments and using PyInstaller to create an executable file for my project.

What I learned

Overall, my experience with this project helped me develop a deeper understanding of both Python and Python's GUI libraries, specifically Tkinter and CustomTkinter. I explored every widget CustomTkinter had to offer and learned the ins and outs of how pack() and grid() work, as well as how to style my project to my liking. Additionally, after hours of troubleshooting with the Windows terminal, I can now efficiently navigate file paths using cd and have gained a deeper understanding of how to manage virtual environments.