./sample.i \
./tests/hello.i \
./tests/iogerunds.i \
+ ./tests/permute.i \
./tests/sink.i \
./tests/test1.i \
./tests/limits.i \
test: $(TARGETS)
@beer | regresscheck beer
- @tests/count | regresscheck tests/count
- @tests/hello | regresscheck tests/hello
@echo 'Hello, sailor!' | regresscheck icat
@echo 'A man, a plan, a canal, Panama.' | rot13 | regresscheck rot13
@echo 'A man, a plan, a canal, Panama.' | rot13b | regresscheck rot13b
@echo "FIVE" | pi | regresscheck pi
+ @tests/count | regresscheck tests/count
+ @tests/hello | regresscheck tests/hello
+ @tests/permute | regresscheck tests/permute
@tests/sink 2>&1 | regresscheck tests/sink
@echo "Tests complete."
+# Needs special handling because the -m option is required
+tests/permute: tests/permute.i
+ $(ICK) -m tests/permute.i
+
./lib/syslib3: ./lib/syslib.3i
cp ./lib/syslib.3i ./lib/syslib3.3i
$(ICK) ./lib/syslib3.3i
permute.i prints the permutations of the set {1,2,3,4,5,6}, using
backtracking (and therefore must be compiled with the -m compiler
-option). The following is the program translated into a mix of Prolog
+option). In the output, numbers in a permutation are given one per line,
+with each digit list followed by XXX.
+
+This program is an excellent regression test because it uses a large
+crossection of INTERCAL control structures; computed COME FROM,
+ordinary COME FROM, ABSTAIN/REINSTATE, AGAIN, NEXT, and MAYBE/GO
+AHEAD/GO BACK are all used. Only ONCE (which is implied in the program
+due to the abstention/reinstatement of an AGAIN line) and IGNORE are
+left unused (at least until someone invents a new even nastier control
+structure). Unusually, it only contains three nontrivial expressions
+(those other than a single constant or a single variable).
+
+The following is the program translated into a mix of Prolog
and C, with some INTERCAL operations (gets, stash, retrieve, giveup)
scattered throughout the program.
a line number, without any obvious clue to this effect in the source
code. while() can often be transformed into do..while(), and even in
situations where it can't, an extra COME FROM does the trick.
-
-This program uses a large crosssection of INTERCAL control structures;
-computed COME FROM, ordinary COME FROM, ABSTAIN/REINSTATE, AGAIN,
-NEXT, and MAYBE/GO AHEAD/GO BACK are all used. Only ONCE (which is
-implied in the program due to the abstention/reinstatement of an AGAIN
-line) and IGNORE are left unused (at least until someone invents a new
-even nastier control structure). Unusually, it only contains three
-nontrivial expressions (those other than a single constant or a single
-variable).
\ No newline at end of file