chiark
/
gitweb
/
~ian
/
z3-treefoil
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(initial)
wip
author
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Sat, 29 Oct 2022 18:39:08 +0000
(19:39 +0100)
committer
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Sat, 29 Oct 2022 18:39:08 +0000
(19:39 +0100)
analyse
[new file with mode: 0755]
patch
|
blob
diff --git a/analyse
b/analyse
new file mode 100755
(executable)
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 $!;