|
One thing that seperates ICON from other languages is the use
of generators. I have written a simple program that outlines
the uses of the different generators.
ICON also supports powerful text processing functions reminiscent
of the SNOBAL family of languages from which it is derived. Here
is a simple program to change the background colors of several HTML
files using fast simple coding techniques. Line #10, which is commented
out, can be used on a Unix based system to get the file list of
a folder and place it in an array.
2D Graphics is also made easy with the use of built in functions.
I have made a quick program similar to Microsoft's Paint application
that comes with Windows. This program isn't complete as it only
took me one evening to code. Just another example of how ICON can
be used for fast prototyping.

My Final Example combines all of the above concepts along with
artificial intelligence to create the game Foxes and Rabbits.
The object of the game is to get all the foxes and rabbits onto
the other side of the river. The rules are that only two animals
can go on the raft at a time, and if there is a greater number of
foxes than rabbits on either side at any time, the Foxes will eat
the rabbits and the game will end. However, if there are zero rabbits
on a given side, there can be any number of foxes on that side.
Get it? Here's the code and windows program.
I have also written some A.I. code to solve the algorithm for you
and animate the program. this is an external program to the Foxes&Rabbits
application that prints and returns the solution.
|