Basic Tips
- Most whitespace is optional:
FORiFROM1TO9DOprint(i)OD
- You can omit different parts of
FOR:
FORiTO9DOprint(i)OD - loops from 1 to 9
TO9DOprint(i)OD - loops 9 times
FORiDOprint(i)OD - counts up from 1 forever
- Use
(…|…|…) instead of IF … THEN … ELSE … FI or CASE … IN … OUT … ESAC
MOD is %*, OVER is %, ** is ^
Numerics
You can set the precision of LONG LONG INT and LONG LONG REAL to arbitrary numbers of digits by using a pragma like PRprec=1000PR (1000 digits). This can appear absolutely anywhere in your code, so put it somewhere that doesn't require any whitespace around it.
Patterns
- C-Style format specifiers are useful: use
printf(($%dl$,i)) instead of printf(($g(0)l$,i))
- Use
q instead of " "
- Use
n(...) to replicate something, e.g. printf($%n(j)q$) to print j spaces (page 155 of the manual)