#!/usr/bin/perl

#This script will take all the files in the directory svjpg and cement them together, all with colours 1 1 1

#if ($#ARGV != 1){ die("you must enter start and end numbers values")};

if (-e("cement.txt")){ die("cement.txt file already present")};

if ($#ARGV==1) {
  $start=$ARGV[0];
  $end=$ARGV[1];
}
else {
  $start=100;
  $end=999;
  printf("start defaulting to %d; end defaulting to %d\n",$start,$end);
}

for ($counter=$start;$counter<=$end;$counter++) {
	if (-e "svjpg/sv$counter.jpg") {
	   `echo  "svjpg/sv$counter.jpg 1 1 1" >> cement.txt`;
	}
}

`./trowel.pl`;
#Now convert the output into a jpg
#`./plm2jpg trowel_out.plm trowel_out.jpg`;
#`./plm2pnm trowel_out.plm -o trowel_out.jpg`;

#`zgv trowel_out.jpg`;
`zgv trowel_out.ppm`;
 
