home *** CD-ROM | disk | FTP | other *** search
- # tests out arrays in general, and routines in array.ic in particular
-
- read "array.ic" # doesn't hurt to re-read it...
-
- silent # doesn't affect echo or display
-
- array ta1[5] = {1,2,3,4,5}; # test array 1
- array ta2[5] # test array 2
-
- echo "\nShould be 1 .. 5"
- display(ta1)
-
- echo "\nShould be 1! .. 5!"
- map(ta1,fact(x)) # ta1[i] = ta1[i]!
- display(ta1)
-
- echo "\nShould be 1▓ .. 5▓"
- fill(ta2, n*n) # fill it with first 5 squares
- display(ta2)
-
- echo "\nShould be 1▓ .. 5▓"
- copy(ta1, ta2) # ta1[i] = ta2[i]
- display(ta1)
-
- echo "\nShould be 1 .. 5, then 1^3 .. 5^3"
- tabulate(ta1,ta2,1,5,x^3)
- display(ta1)
- echo
- display(ta2)
-
- echo "\nThat's all folks!"
-
- verbose # results/prompt back on
-