I got a QiYi Coin Pyraminx from Puzzlcrate (image link), and over the course of 3 days, I made a random-state scrambler for the puzzle!
Link: https://onlinegdb.com/rJPKF2ZzP
Press "Run" or the F9 key to run the program.
Scramble notation: Uppercase letters are for corners, lowercase letters are for centers.
The program generates 5 scrambles. If you want to change that number, scroll to the very top of the program where it says "number_of_scrambles = 5" and replace the 5 with whatever integer you like. This can't be done at this link, though—you'll have to copy and paste the code somewhere. It'll output the scrambles as it makes them. It runs very slowly on this website, so if you have the means to run Python programs on your computer, I'd recommend copying and pasting the code there.
Also, please ignore how messy my code is, I didn't originally intend for other people to see it
How it works:
The entire program is written in Python 3.7.3. It starts by generating a random permutation with the help of the random.randint() function from the random module. From a solved state, it turns each of the four corners either clockwise, counterclockwise, or not at all. Then, it randomly places the (moveable) centers around the puzzle, resulting in a scrambled position with equal probability of every configuration. There aren't any unsolvable positions on the Coin Pyraminx, so I don't have to worry about that.
It then generates a solution to the permutation using what I call the five-phase algorithm. It generates an optimal solution to each of the five steps I've defined, which are as follows:
1) Solve a 1x5 block (i.e. a face minus two stickers) on the left side of the D face <U, L, R, B, d, l, r, f>
2) Finish the D face by solving the two rightmost stickers <U, L, R, B, l, r, f>
3) Solve the bottom two centers of the L face <U, l, r, f>
4) Solve the bottom two centers of the F face <U, r, f>
5) Solve the bottom 2 centers of the R face along with all 3 top centers and the U corner <U, r>
Once the solution is generated, it's inversed to get the scramble, and the program attempts to cancel moves to shorten it.
The average scramble length is 15.9 moves with a sample size of 1,000 scrambles. Within that sample, the longest scramble was 24 moves, and the shortest one was 7 moves.
I don't think there are any bugs in the program, but if you find any, please let me know and I'll try to fix them
Also, I didn't implement every possible move cancellation—so if you see moves that can be canceled (like U L U' or something like that), let me know and I'll add it to the list.
This is my first time attempting to make a random-state scrambler, so I'm proud of how it turned out!
Link: https://onlinegdb.com/rJPKF2ZzP
Press "Run" or the F9 key to run the program.
Scramble notation: Uppercase letters are for corners, lowercase letters are for centers.
The program generates 5 scrambles. If you want to change that number, scroll to the very top of the program where it says "number_of_scrambles = 5" and replace the 5 with whatever integer you like. This can't be done at this link, though—you'll have to copy and paste the code somewhere. It'll output the scrambles as it makes them. It runs very slowly on this website, so if you have the means to run Python programs on your computer, I'd recommend copying and pasting the code there.
Also, please ignore how messy my code is, I didn't originally intend for other people to see it
How it works:
The entire program is written in Python 3.7.3. It starts by generating a random permutation with the help of the random.randint() function from the random module. From a solved state, it turns each of the four corners either clockwise, counterclockwise, or not at all. Then, it randomly places the (moveable) centers around the puzzle, resulting in a scrambled position with equal probability of every configuration. There aren't any unsolvable positions on the Coin Pyraminx, so I don't have to worry about that.
It then generates a solution to the permutation using what I call the five-phase algorithm. It generates an optimal solution to each of the five steps I've defined, which are as follows:
1) Solve a 1x5 block (i.e. a face minus two stickers) on the left side of the D face <U, L, R, B, d, l, r, f>
2) Finish the D face by solving the two rightmost stickers <U, L, R, B, l, r, f>
3) Solve the bottom two centers of the L face <U, l, r, f>
4) Solve the bottom two centers of the F face <U, r, f>
5) Solve the bottom 2 centers of the R face along with all 3 top centers and the U corner <U, r>
Once the solution is generated, it's inversed to get the scramble, and the program attempts to cancel moves to shorten it.
The average scramble length is 15.9 moves with a sample size of 1,000 scrambles. Within that sample, the longest scramble was 24 moves, and the shortest one was 7 moves.
I don't think there are any bugs in the program, but if you find any, please let me know and I'll try to fix them
Also, I didn't implement every possible move cancellation—so if you see moves that can be canceled (like U L U' or something like that), let me know and I'll add it to the list.
This is my first time attempting to make a random-state scrambler, so I'm proud of how it turned out!
Last edited: