4 # Convert a deity dump file into a Portable GreyMap of country numbers
16 des[$2]=substr($3,0,1);
28 if ($2 < left) left=$2;
29 if ($2 > right) right=$2;
31 if ($3 > bottom) bottom=$3;
36 /^World size is [0-9]+ by [0-9]+./ {
46 printf("P2\n%d %d\n255\n",right-left+2,bottom-top+1);
47 for (y=top;y<=bottom;y++) {
51 if (color==0 && des[right,y]!=".") color=254;
54 for (x=left + abs(y%2);x<=right;x+=2) {
56 if (color==0 && des[x,y]!=".") color=254;
57 printf("%d %d\n",color,color);
61 if (color==0 && des[left,y]!=".") color=254;