Under the demos directory you'll find a random assortment of Fran demos. Each
has a "main" and so can be started either with hugs.exe, typing "main"
to the prompt, or with runhugs.exe, in which case there will be no prompt.
As examples of how to program reactive behaviors, I particularly recommend Fifteen and
Navigate. Some of the examples have space leaks. :(
Here is a brief description of each.
- Test: For my own testing, but contains some nice ones. For instance,
try "displayU crop4" and move the mouse around.
- Tutorial: Examples used in the Fran tutorial. See the file for a web
pointer, which has lots of animated GIFs. Step forward through the examples with space,
right arrow, or "n". Step backward with left arrow or "p".
- SpiroKids: Well, it's just weird. Try it out! You may want to adjust numKids
to suit your machine's performance.
- UsersMan: Goes with the User's Manual.
- Sokoban\SokoMain: The classic game of Sokoban. Try to push the gold
ball into the black holders. Really too slow to be fun yet.
- CurveEditor\Editor[0-6]: An interactive curve editor. This example
illustrates event-oriented programming and is described in an upcoming paper.
- Navigate\Main: Two-handed navigation. Works with tablet if you have
one. Grab the image by grabbing with the left mouse button or the stylus tip or both
simultaneously. Move the mouse or stylus in these cases and see what happens. If you don't
have a tablet, replace "stylusHand" with "keyHand" in the Main.hs.
Then use shift to grab and arrow keys to move. (To do: make tablet availability a testable
property of users, so this change can be done automatically.) If you want to use
your left hand for the mouse, swap RightH and LeftH in Main.hs.
- Fifteen\Main: The classic "fifteen puzzle", invented in the
1870's, apparently by Sam Loyd (1841-1911). Use the arrow keys to move pieces around. Try main1
for the version with the numbers, main2 for one based on a picture, or main3
(also main) for an undulating picture.
- Collide\Main: Colliding balls. Use the mouse to add balls. Press the
left button and hold it to create a new ball. Move around and release to impart initial
position and velocity. Add some more, depending on how fast your machine is.
- LiftSim\Main: Lift (elevator) simulator by Simon Thompson. Click on the
"up" or "down" button to call the lift up or down. If the lift cannot
service your request right away, the call button lights up and the lift comes when it can.
See Simon's technical
report about this example, which also sheds light on Fran programming in general.
Last updated: June 19, 1998