shithub: sce

ref: 57d547f1bbfca33c49e10bcf4d55e6fba2e47067
dir: sce/utils/genmap

View raw version
#!/bin/rc
if(! ~ $#* 4){
	echo usage: $0 x y tlend tileset >[1=2]
	exit usage
}
awk -v 'x='$1 -v 'y='$2 -v 'e='$3 -v 't='$4 '
BEGIN{
	srand()
	print "tileset," t
	while(y-- > 0){
		printf "map"
		for(i=1; i<=x; i++){
			v = 1 + rand() * 1000000 % e
			printf ",%s", int(v)
		}
		printf "\n"
	}
}
'