Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extra commas in algorithms should throw an error #44

Closed
bugybunny opened this issue Jan 16, 2018 · 3 comments
Closed

Extra commas in algorithms should throw an error #44

bugybunny opened this issue Jan 16, 2018 · 3 comments

Comments

@bugybunny
Copy link

For example in the algorithm shape visualizer https://rawgit.com/sp3ctum/squanmate/master/resources/public/#/shape-visualizer/square/left-pawn/(-5%2C-4)/(-1%2C0)%2F1%2C0%2F0%2C-2%2C%2F-1%2C-2%2F

Screenshot for later when this is fixed
image

Notice the extra comma in 0,-2,/. I accidentally wrote that and could not figure out for a long time why the images were not generated for a part of the algorithm :D I would suggest, that Squanmate should check for multiple commas between two slashes and if it’s illegal, just throw an error as an unsliceable position does. I guess Squanmate does already do something like this because the visualization just stops because of an error I guess.

This is not only in the alg shape visualizer but also the scramble inspector. If I enter 1,0/-1,0,/-3,0/ I get just
image

Not only commas are a problem, but every other illegal character. If you already check if something in the algorithm is legal and get no as an answer, just pass the error to the user.

@mikavilpas
Copy link
Owner

Oops, this is definitely a bug. Good find.

@mikavilpas
Copy link
Owner

Okay, I managed to fix this (319ee7c). Here's what your case looks now:

image

The error message may be a bit confusing. Basically the algorithm parser looks for a slice, rotations, or a * character, or the end of the algorithm. It hasn't found the previous ones at that position, so it's only expecting the algorithm to end.

But at least it shows the position where the error is now, instead of hiding it.

@mikavilpas
Copy link
Owner

Released now in version 6.6.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants