• Welcome to SpeedSolving.com — the world’s largest puzzle community!

    You’re currently browsing as a guest, which means you have limited access to discussions, resources, member profiles, and community features.

    Join 50,000+ cubers and puzzle enthusiasts from around the world to ask questions, share solves, improve faster, and be part of the community.

    Registration is free, fast, and easy — create your account today.

    Already a member? Log in here to hide this message and start participating.

Help on Coding a Blindfolded Memo Generator

Joined
Jan 18, 2021
Messages
6
Hi,
I have been working on coding this blindfolded memo generator in javascript. It has been working pretty good so far but it doesn't quite work properly and I still can't figure out why. I have it broken down into two sections, the edges memo, and the corners memo. For the edges memo it can generate up to the buffer and go past the buffer only once, and then it thinks the cube is solved for some reason. Here is the code for it, I would really appreciate it if you could pick over it and help me figure out what went wrong with it. Thanks!
 

Attachments

Hi,
I have been working on coding this blindfolded memo generator in javascript. It has been working pretty good so far but it doesn't quite work properly and I still can't figure out why. I have it broken down into two sections, the edges memo, and the corners memo. For the edges memo it can generate up to the buffer and go past the buffer only once, and then it thinks the cube is solved for some reason. Here is the code for it, I would really appreciate it if you could pick over it and help me figure out what went wrong with it. Thanks!
Hello Just Solve Cubing,

I had a scan through your code. I noticed that your file only contained the script for corners but your original post seemed to suggest the problem was with edges.

TLDR: The issue is that when the algorithm enters a cycle that does not start with the initial buffer it assumes the first piece in the cycle is solved after it is swapped.

Here are my observations from the corner.js file:

In the generateCornersMemo function I noticed that the line "currentBuffer = getOptions(memo)[0];" was commented out in the first if statement. Uncommenting this stops the function from going into an infinite loop. (If the line is commented then the buffer never switches from 'e' which causes an infinite loop.)
I commented out the line below it to remove duplicate letters being pushed to the memo. This happens because there are two places in the function where the memo can be pushed and if the buffer at the start of the loop is a,e,f and then changes, both instances are called.

To test the function I used the scramble: R2 because it has a solved buffer and is made up of two different corner cycles. The memo it gave was 'bvcw', which is almost correct. It should give 'bvbcwc'. The reason why it missed out the 'b' and 'c' is because once the algorithm reaches the end of a cycle it defaults back to 'e' and not the first letter of the cycle.

I think this is what is causing your program to break early since it assumes the initial cycle piece is solved after it has been swapped.

If you need any more help let me know.
 
Back
Top