#! /usr/bin/gawk -f # Last edited on 2000-09-21 16:51:41 by stolfi BEGIN { split("", ct_mg); split("", ct_m); split("", ct_g); ct = 0; if (attr == "") { arg_error("must set \"attr\""); } split("", lin); nc = 0; width = 50; } /^ *$/ { print_line(); next; } /./{ if (attr == "g") { v = extract_gallows_attr($0); } else if (attr == "m") { v = extract_mantle_attr($0, 0,0,0); } else if (attr == "ed") { v = extract_e_d_attr($0); } else if (attr == "r") { v = extract_random_attr($0, 0.333333); } else { arg_error("unrecognized \"attr\""); } v = (v >= 10 ? 9 : v); v = (v == -1 ? "?" : v); if (length(v) != 1) { input_error("bad attribute value"); } if (nc >= width) { print_line(); } lin[nc] = v; nc++; } END { if (nc > 0) { print_line(); } } function print_line( i) { for (i=0; i "/dev/stderr"; abort = 1; exit abort; } function input_error(msg) { printf "file %s, line %d: %s\n", FILENAME, FNR, msg > "/dev/stderr"; abort = 1; exit abort; }