From: Ian Jackson Date: Sat, 29 Oct 2022 18:39:08 +0000 (+0100) Subject: wip X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=e427dfe853666a04a86ee1859ce6ffbc7edd725f;p=z3-treefoil wip --- e427dfe853666a04a86ee1859ce6ffbc7edd725f diff --git a/analyse b/analyse new file mode 100755 index 0000000..a9cb8f3 --- /dev/null +++ b/analyse @@ -0,0 +1,24 @@ +#!/usr/bin/perl -w + +use strict; + +while (<>) { + my @coords = qw(0 0 0); + chomp; + my $l = $_; + print join '', @coords; + while ($l =~ s/^.//) { + $_ = $&; + my $delta = s/[A-Z]/lc $&/e ? +1 : -1; + my $i = + $& eq 'X' ? 0 : + $& eq 'Y' ? 1 : + $& eq 'Z' ? 2 : + die; + $coords[$i] += $delta; + print " ", join '', @coords; + } + print "\n"; +} + +STDOUT->error and die $!;