[m-dev.] ICFP Contest: trk2xpm.sh

Peter Moulder pmoulder at mail.csse.monash.edu.au
Sat Jun 28 14:24:15 AEST 2003


To let you see the given tracks, here's a little script to convert them
to xpm's, using something like the below.

  for i in *.trk;do b=`basename $i .trk`;../trk2xpm.sh < $i > $b.xpm;done

pjm.


#! /bin/sh
cat <<EOF
/* XPM */'
static char *track[] = {
"1024 768 7 1",
".	c #000000",
"*	c #ffff00",
"!	c #ff8800",
"g	c #00ff00",
"r	c #ff0000",
"w	c #ffffff",
"b	c #0000ff",
EOF
sed '1,2d;s/^/"/;3,769s/$/",/;770s/$/"};/' $1

--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list