Speffz BLD tools: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
mNo edit summary |
||
Line 8: | Line 8: | ||
#!perl -w | #!perl -w | ||
use strict; | use strict; | ||
use | use tmstub; | ||
=for docs | |||
This is in perl for brevity but could be any language - it's just a vehicle | |||
for the programming concepts. | |||
https://www.speedsolving.com/wiki/index.php/Speffz | |||
TODO: - | |||
apply given scramble | |||
unit tests | |||
generic abstract canvas style GUI | |||
port it to various other languages | |||
Transforms for each face turn move | |||
Words for letter pairs! | |||
=cut | |||
t "Yo, let's speffz it up..."; | |||
my $scr = shift || "R U R' U'"; | my $scr = shift || "R U R' U'"; | ||
my $debug = 1; | my $debug = 1; | ||
Line 16: | Line 32: | ||
#~ print $cs; | #~ print $cs; | ||
#~ print "\n"; | #~ print "\n"; | ||
my $p = draw($cs); | my $p = draw($cs, 1); | ||
t $p; | |||
$p = draw($cs, 0); | |||
t $p; | |||
## Unscrambled 3x3 cube state in speffz format | ## Unscrambled 3x3 cube state in speffz format - clockwise lettering of stickers | ||
sub fresh_cube { | sub fresh_cube { | ||
my $s = ""; | my $s = ""; | ||
Line 33: | Line 50: | ||
return ($1, $2, $3, $4, $5, $6); | return ($1, $2, $3, $4, $5, $6); | ||
} | } | ||
## Draw the given cube state as a human-friendly net | ## Draw the given cube state as a human-friendly net | ||
# here we can support different face orders | # here we can support different face orders | ||
Line 77: | Line 95: | ||
sub draw { | sub draw { | ||
my $s = shift; | my $s = shift; | ||
my $boxes = | my $boxes = shift; | ||
my @a = faces($s); | my @a = faces($s); | ||
#~ print Dumper(\@a); | #~ print Dumper(\@a); | ||
Line 112: | Line 130: | ||
} | } | ||
## Convert a face into 3 rows of 3 stickers - top to bottom, left to right | |||
sub facerows { | sub facerows { | ||
local $_ = shift; | local $_ = shift; | ||
Line 117: | Line 136: | ||
return [[$c[0], $c[1], $c[2]], [$c[7], '*', $c[3]], [$c[6], $c[5], $c[4]]]; | return [[$c[0], $c[1], $c[2]], [$c[7], '*', $c[3]], [$c[6], $c[5], $c[4]]]; | ||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
</div> | </div> |
Latest revision as of 23:31, 2 July 2018
A program to generate a BLD memo sequence in speffz from a standard WCA scramble.
A work-in-progress: needs scramble parser and performer