Difference between revisions of "Speffz BLD tools"
Jump to navigation
Jump to search
(Created page with "A program to generate a BLD memo sequence in speffz from a standard WCA scramble. <div style ="height:200px;overflow-x:hidden;overflow-y:auto;border: 4px solid green;"> <synt...") |
m |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
A program to generate a BLD memo sequence in speffz from a standard WCA scramble. | A program to generate a BLD memo sequence in speffz from a standard WCA scramble. | ||
+ | |||
+ | A work-in-progress: needs scramble parser and performer | ||
<div style ="height:200px;overflow-x:hidden;overflow-y:auto;border: 4px solid green;"> | <div style ="height:200px;overflow-x:hidden;overflow-y:auto;border: 4px solid green;"> | ||
Line 6: | 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 14: | 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 31: | 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 75: | 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 110: | 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 115: | 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