From e427dfe853666a04a86ee1859ce6ffbc7edd725f Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sat, 29 Oct 2022 19:39:08 +0100 Subject: [PATCH] wip --- analyse | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 analyse 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 $!; -- 2.30.2