The Code models a Rubik’s cube with six String arrays modeling the six sides of the cube. Every move on the cube is modeled as a permutation of these arrays. There are six moves: F, R, L, T, D, and B. they represent turning a specific face clockwise. (B represents the back face and D represents the Bottom face).
The operations of a Rubik's cube are an algebraic group because they have closure, inverses, and an identity. This means that combining any set off operations will be in itself an operation on the cube. For any operation, there is another operation that will undo that operation. And, there is an operation that does nothing (We can call this I, it consists of merely looking at the cube and not touching it). Because it is a finite group, every element must have finite order. This means that starting from a given configuration of the cube, performing the same operations n times will result in the cube returning to that configuration. We call n the order of the operation. For example, F has order 4, because rotating the top face four times is the same as not rotating the top face at all. Another example is that FR has order 105. Meaning that if we rotate the top face counter clockwise then rotate the Right face, and we repeat this process 105 times we get back to where we started.
My program will take an input of some operation, input as a string of the capital letters F, R, L, T, D or B, and return the order of that operation. It does this by modeling the cube and iterating through that operation until the cube is solved. This is, admittedly, cheating. There are better ways of finding the order of an element without brute forcing it and I plan to create another program to fiddle with this soon.