Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] View of /branches/lamont/test/life2/0-gen-glider.sh
ViewVC logotype

View of /branches/lamont/test/life2/0-gen-glider.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3367 - (download) (as text) (annotate)
Mon Nov 2 13:05:52 2015 UTC (4 years, 5 months ago) by glk
File size: 570 byte(s)
bug: cells do not reliably have 8 neighbors
#!/usr/bin/env bash
set -o errexit
set -o nounset
JUNK=""
function junk {
  JUNK="$JUNK $@"
}
function cleanup {
  rm -rf $JUNK
}
trap cleanup err exit int term

sizeX=8
sizeY=9

echo "0 0 0 0 0 0
      0 0 0 0 0 0
      0 0 0 1 0 0
      0 0 0 0 1 0
      0 0 1 1 1 0
      0 0 0 0 0 0" |
unu reshape -s 6 6 |
unu pad -min 0 0 -max $[$sizeX-1] $[$sizeY-1] |
unu basinfo -orig "(0,0)" -spc "2d-space" |
unu axinfo -a 0 -dir "(1,0)" -k space |
unu axinfo -a 1 -dir "(0,1)" -k space |
unu dnorm -o - |
unu convert -t float |
unu pad -min -2 -2 -max M+2 M+2 -o glider.nrrd

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0