Skip to content

Instantly share code, notes, and snippets.

@iomonad
Created December 18, 2022 14:28
Show Gist options
  • Save iomonad/692752be68dcd9af8ae4f8dcaa80aa06 to your computer and use it in GitHub Desktop.
Save iomonad/692752be68dcd9af8ae4f8dcaa80aa06 to your computer and use it in GitHub Desktop.
Iterate over disk pack in binding order looking for any disk not within true-jiggle range of *any* gate (a disk that is between gates)
if found:
all previous disks have true-jiggle centered on the gate they were aligned with
this disk has no jiggle
all subsequent disks have full-jiggle (can be moved from 0 up to 5)
return binder found
else:
all disks are in *a* gate. iterate again searching for a disk within true-jiggle of a false gate
if found:
this disk has false-jiggle
all other disks have true-jiggle
return binder found
else:
if nothing found, lock must be open. return no binders found
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment