From: Ian Jackson Date: Sat, 29 Oct 2022 18:45:36 +0000 (+0100) Subject: wip before Rust X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=837ad6a076d4d7fdf9db336bd01c9470a21e3845;p=z3-treefoil wip before Rust --- diff --git a/analyse b/analyse index e28e1ce..ebbc2b8 100755 --- a/analyse +++ b/analyse @@ -1,24 +1,8 @@ -#!/usr/bin/perl -w +#!/bin/sh -use strict; +./vertices >t.vx -while (<>) { - my @coords = qw(0 0 0); - chomp; - my $l = $_; - for (;;) { - print join '', @coords, ','; - last unless $l =~ s/^.//; - $_ = $&; - my $delta = s/[A-Z]/lc $&/e ? +1 : -1; - my $i = - /x/ ? 0 : - /y/ ? 1 : - /z/ ? 2 : - die "$_ ?"; - $coords[$i] += $delta; - } - print "\n"; -} - -STDOUT->error and die $!; +for x in 0 3; do for y in 0 3; do for z in 0 3; do + grep $x$y$z, t.vx >u.vx + mv u.vx t.vx +done; done; done diff --git a/vertices b/vertices new file mode 100755 index 0000000..e28e1ce --- /dev/null +++ b/vertices @@ -0,0 +1,24 @@ +#!/usr/bin/perl -w + +use strict; + +while (<>) { + my @coords = qw(0 0 0); + chomp; + my $l = $_; + for (;;) { + print join '', @coords, ','; + last unless $l =~ s/^.//; + $_ = $&; + my $delta = s/[A-Z]/lc $&/e ? +1 : -1; + my $i = + /x/ ? 0 : + /y/ ? 1 : + /z/ ? 2 : + die "$_ ?"; + $coords[$i] += $delta; + } + print "\n"; +} + +STDOUT->error and die $!;