DataMuseum.dk

Presents historical artifacts from the history of:

DKUUG/EUUG Conference tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about DKUUG/EUUG Conference tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download
Index: T c

⟦b89b65d0e⟧ TextFile

    Length: 1021 (0x3fd)
    Types: TextFile
    Names: »cubeorder.sh«

Derivation

└─⟦b20c6495f⟧ Bits:30007238 EUUGD18: Wien-båndet, efterår 1987
    └─⟦this⟧ »EUUGD18/General/Cubes/cubeorder.sh« 

TextFile

: ksh or sh
# vi:set sw=4 ts=4
# cubeorder: sort players in temperament/strategy order

PATH=/bin:/usr/games

umask 066
tmp=/tmp/cubeorder.$$
trap "rm -f $tmp;exit 1" 1 2 3 15

rm -f $tmp
echo "BEGIN {" > $tmp

cuberank -T | awk '
	BEGIN {
		n = 1
	}
	$1 ~ /[0-9]/ {
		printf("\ttemp[%d]=\"%s\"\n", n, $2)
		printf("\tthdr[%d]=\"%s\"\n", n, $0)
		++n;
	}
	END {
		printf("\ttemps=%d\n", n)
	}
' >> $tmp

cuberank -S | awk '
	BEGIN {
		n = 1
	}
	$1 ~ /[0-9]/ {
		printf("\tstrat[%d]=\"%s\"\n", n, $2)
		++n
	}
	END {
		printf("\tstrats=%d\n", n)
	}
' >> $tmp

cat >> $tmp <<\ENDCAT
}
$1 !~ /[0-9]/ {
	hdr = $0
	next
}
{
	nam = substr($9, 1, 3) substr($10, 1, 3)
	if(list[nam] == "")
		list[nam] = $0
	else
		list[nam] = list[nam] "\n" $0
}
END {
	for(t = 1;t < temps;++t) {
		print hdr
		for(s = 1;s < strats;++s) {
			nam = substr(temp[t], 1, 3) substr(strat[s], 1, 3)
			if(list[nam] != "")
				print list[nam]
		}
		print thdr[t]
		print ""
	}
}
ENDCAT

cuberank -sP | awk -f $tmp | sed -e 's/_/ /g'

rm -f $tmp
exit 0