[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[school-discuss] how to turn addpsx.pl into a subtraction worksheet generator



Greetings,
First off, the script I'm referring to can be found here:
http://www.seul.org/edu/packages/addpsx.pl
It generates a 1-page postscript file containing random addition problems. I was easily able to modify it to output multiplication problems:

$t=$a+$b;
ps_digits($a);
ps_digits("+ ".$b);
print "S\n";
# ps_digits($t); # don't print answer
ps_digits(""); # skip a line instead

Just change the "+ " to "x ". However, the same trick does not work with subtraction: substituting in "- " causes errors. Ghostscript viewing reports "undefined in d-", and an actual printout says "ERROR: undefined. OFFENDING COMMAND: d-. STACK: -108".

I've tried various things, such as backslashes before the -, and separating the "- " out into a separate print line (which I thought would work but generate funky output...didn't work, same error). Any ideas?

Thanks,
Jake Maul
Paradise Valley Unified School Dist.
Phoenix, AZ