

                         Delphi Noetic Systems, Inc.


=============================================================================

              Contents of the F-Basic System Sample Programs Disk

=============================================================================

INTRODUCTION

     The enclosed F-Basic System Sample Programs disk contains over 85
source programs written in the F-Basic language.  By examining, compiling,
and running those which use the specific features of the language that you
are interested in, the authors hope to acquaint you with the power, speed,
and flexbility of the F-Basic System.

     If you have at least a two drive system (one additional external drive
df1:), the easiest way to compile and run the sample programs is:

     1. Read Chapter 1 of the F-Basic System User's Manual to acquaint
        yourself with the FastCom compiler's operation.

     2. Boot your Amiga with the F-Basic System disk in the internal
        drive and the F-Basic System Sample Programs disk in the
        external drive.

     3. To compile a sample program (for example GfxsTest24), type:

                        1>FB df1:GfxsTest24 test.bin

        This will compile the test program and place the object code
        in the file called "test.bin" of the internal drive.

     4. To run the program, type:

                              1>test.bin

     If you have a single drive system, the sample programs that you desire
to compile and execute should be first moved to the System Disk.
Alternatively, for those with extended memory systems, the FastCom compiler
can be moved to the RAM: disk, as described in Chapter 1 of the F-Basic
System User's manual. This will enable you to utilize the internal drive to
hold the F-Basic System Sample Programs disk.


THE SAMPLE PROGRAMS

     1. Animation1 - Demonstrates simple sprite animation in F-Basic

     2. Animation2 - Demonstrates simple bob animation in F-Basic

     3. Animation3 - Demonstrates more complex animation in F-Basic

     4. CribbageCombos1 - Asks for the number of cards in the user's hand
and the target number. It then recursively computes the number of ways of
permuting the cards to get the target number.

            Example Input: 7,8 (7 cards and 8 is the target)
            Cards Input One To A Line: 1,2,3,4,5,6,7
            Answer: There are 5 ways to get to 8.

     5. CribbageCombos2 - Same as CribbageCombos1, except an iterative,
rather than recursive, solution is demonstrated.

     6. CursorControl - Demonstrates the cursor control and line and blank
features of F-Basic. No user input requested - simply compile, run, and
watch.

     7. Date - Program converts DateStamp returned by F-Basic's DOSTIME
function to calendar date string, e.g. "Saturday, January 7, 1989".

     8. DOSDate - This program gathers date from the DOSDATE function and
manipulates it (using the Pattern Matching capabilities of F-Basic) to find
the day of the week, date, and time. This is useful for programmers that
want to display one or more of these quantities in their programs.

     9. Dunk.Source - This program demonstrates the IFF file capabilities of
F-Basic 2.0. It reads and displays the file ArtGallery/Dunk.Info. To
terminate, strike any key.

    10. EightColorWBench.Source - This program changes the WorkBench screen
from 4 colors to 8 colors. Special icons are available to "show-off" the new
colors. FourColorWBench changes the WorkBench screen back to 4 colors.

    11. Extra_Halfbrite.Source - This program demonstrates the
Extra_Halfbrite mode of the Amiga (64 colors at once) using F-Basic.

    12. Fifteen - This program demonstrates the classic fifteen tiles game.

    13. FourColorWBench.Source - This program changes the WorkBench screen
from 8 back to 4 colors. It restores the original WorkBench screen after
EightColorWBench is utilized.

    14. Fractal - Program adapted from Amazing Computing, Volume 4, No. 3,
March 1989, page 86.  Originally written in Amiga Basic by Paul Castonguay.
Program generates beautiful fractal images.

    15. GfxsTest1 - Demonstrates high level custom windows from F-Basic.
Opens a custom window and draws 3 lines therein. Window resides in the
default Workbench screen.

    16. GfxsTest2 - This is a repeat of GfxsTest1, except the window is
opened in a custom low resolution screen.

    17. GfxsTest3 - Demonstrates user defined colors, line drawing, color
reading pixel by pixel, and color complementing in F-Basic. Uses a custom
window defined in a custom screen.

    18. GfxsTest4 - Demonstrates the use of the F-Basic COLOR_POLYDRAW
function by drawing repeated octagons in a custom window defined in a custom
screen.

    19. GfxsTest5 - Demonstrates patterned lines and circle drawing in
F-Basic. Uses the COLOR_PATTERN, COLOR_ELLIPSE, and COLOR_FLOOD statements.

    20. GfxsTest6 - Demonstrates user defined colors, drawing patterned
lines, and changing the drawing mode through the use of F-Basic's
COLOR_PATTERN statement.

    21. GfxsTest7 - Draws a circle, and then demonstrates F-Basic's
COLOR_FLOOD statement to fill the circle and its background with different
colors.

    22. GfxsTest8 - Demonstrates F-Basic's COLOR_ELLIPSE and COLOR_RELLIPSE
statements by drawing cocentric circles in random colors in a custom window
and screen.

    23. GfxsTest9 - Demonstrates F-Basic's COLOR_ELLISPE, COLOR_RELLIPSE,
and COLOR_FLOOD statements by drawing and filling cocentric circles in
random colors in a custom window and screen.

    24. GfxsTest10 - Like GfxsTest4 with the moving octagons, except here
they are drawn with and filled by the COLOR_AREA and COLOR_AREAFILL
statements of F-Basic. Random numbers from the F-Basic RANDOM facility are
used to determine the fill colors used.

    25. GfxsTest11 - Demonstrates patterned fills in all 4 distinct drawing
modes on the Amiga - JAM1, JAM2, COMPLEMENT, and INVERSE VIDEO. Outlines a
random box in a random color and then fills with a user-defined pattern via
F-Basic's COLOR_PATTERN statement.

    26. GfxsTest12 - Beautiful demo of filling a circle, triangle, and
rectangle with a randomly selected fill pattern. Includes the use of
F-Basic's COLOR_PATTERN, COLOR_AREA, and COLOR_AREAFILL statements.

    27. GfxsTest13 - Like the sample titled GfxsTest12, except the multiple
color patterned fill capabilities of the Amiga, as accessed through
F-Basic's COLOR_PATTERN statement, are demonstrated.

    28. GfxsTest14 - Lines and shapes are drawn and filled with random
patterns using the COLOR_PATTERN statement. Includes the use of
COLOR_DEFINE, COLOR_ELLIPSE, COLOR_AREA, COLOR_LINE, and COLOR_BOXFILL.

    29. GfxsTest15 - Like the program called GfxsTest14, except again
multiple color patterns are employed.

    30. GfxsTest16 - Utilizes the F-Basic COLOR_SCROLL statement to simulate
the movement of the Space Invaders video game.

    31. GfxsTest17 - Similar to GfxsTest16, except the relative scrolling
capabilities of the Amiga, as accessed through F-Basic's COLOR_RSCROLL
statement, are utilized.

    32. GfxsTest18 - Demonstrates F-Basic's high level menu interface.
Periodically, touch the right mouse button and drag down the menu while this
one executes. You will notice all the program directed changes in the menu
interface.

    33. GfxsTest19 - Demonstrates F-Basic's high level BLOCK statements.
These allow the programmer to quickly capture a graphics image on the screen
and replicate it throughout a window, or save it in an array or file for
later use.

    34. GfxsTest20 - Further illustrates F-Basic's BLOCK facility by
transferring an image to a second custom window. During execution, click on
the screen depth arrangement gadget to view the window from which the
original image was copied.

    35. GfxsTest21 - Same program as GfxsTest19, except the image is copied
first to an array for permanent storage, then restored from the array and
duplicated througout the window.

    36. GfxsTest22 - Same program as GfxsTest20, except as in GfxsTest21,
the image is transferred between two windows through the use of an
intermediate array for the possible permanent storage of the image.

    37. GfxsTest23 - Demonstrates F-Basic's WINDOW statements which allow
the programmer to move and resize windows as well as arrange their locations
relative to each other. A custom screen and four custom windows are
demonstrated.

    38. GfxsTest24 - Program opens eight custom windows simultaneously to
demonstrate the 32 default colors of the Amiga, the F-Basic version of the
Boxfill demo, the F-Basic version of the random Box demo, the F-Basic
version of the Lines demo, the F-Basic version of the Dots demo, and the
F-Basic version of the Ellipses demo.

    39. GfxsTest25 - Like GfxsTest19, except the relative mode of the BLOCK
statement is utilized.

    40. GfxsTest26 - Illustrates how to open and receive input from a
requester using Intuition's Auto Requester facility coupled with F-Basic's
RECORD structures.

    41. GfxsTest27 - Program demonstrates F-Basic's Event Trapping
facilities. Two windows are opened, and each event in each window is
reported to the user. The events possible in each window are a WINDOW_CLOSE
event, an INKEY (keyboard strike) event, a MENU_SELECT event, a SINGLE_CLICK
event, and finally, a DOUBLE_CLICK event.

    To use, perform an event (one of the above) in the desired window and
watch for the program to report the occurrence of the event to you.

    42. GfxsTest28 - Program uses F-Basic's COLOR_BOX, COLOR_FLOOD, and
SINGLE_CLICK event to simulate a simple requester in a custom window.

    43. GfxsTest29 - Program demonstrates the use of F-Basic's RECORD
structures and ROM Kernel calls to the Graphics and DiskFont libraries to
change the fonts displayed in a custom window.

    44. GfxsTest30 - Program demonstrates F-Basic's ability to interact with
the right joystick/mouse port. Plug a regular joystick into the right port
and this program will report the stick moves and button presses.

    45. GfxsTest31 - Program directly accesses the x and y coordinates of
the mouse pointer at any time, and reports them to the user 10 times.

    46. GfxsTest32 - Program demonstrates the SINGLE_CLICK event in F-Basic.
Push the left mouse button down to mark the beginning of a line, and release
the button to signify the end. The line is then drawn in a random color.
After 15 lines, the program terminates.

    47. Ham - This program is a modification of an example program which
appeared in V3.10 of Amazing Computing (page 89). It demonstrates the Hold
And Modify mode (HAM) of the Amiga,by painting the screen full of HAM colors.

    48. Hanoi - Program outputs a sequence of instructions to solve the
Towers of Hanoi problem.

            Example Input:  Disks To Be Moved? 3
                            Needle To Move From? 1
                            Needle To Move To? 3
                            Needle To Use As Temporary Storage? 2

    49. IntArith1 - Demonstrates integer arithmetic operations in F-Basic,
both on optimized FAST and unoptimized variables. Correct output: 318,
187200, 5830380, 2, 582.

    50. IntArith2 - Further tests of integer arithmetic operations in
F-Basic. Additionally, nested FOR loops are utilized. Correct output:
100125, 99, 1177, 15210, 235350.

    51. IntArith3 - Integer arithmetic on integer arrays. Correct output:
99, 420.

    52. IntArith4 - Tests integer arithmetic on arrays by finding and
outputting all primes below 100.

    53. Jumble1 - Program simulates the word "shuffling" game Jumble. Enter
a string of letters, and all the permutations of those letters are
displayed. Note that duplicate permutations are not output.

    54. Jumble2 - Like Jumble1, except a more compact recursive algorithm is
used in the program.


        The next seven sample programs illustrate the ease with which C
programs that interact directly with the ROM Kernel of the Amiga can be
programmed in F-Basic. The RECORD structures, file INCLUDE and APPEND, and
&SYSLIB interface of F-Basic are demonstrated. NOTE:  These programs assume
that the "finclude" directory of the F-Basic System boot disk is present.
Many include files are located here.

    55. LikeC1 - This program defines MenuItem and MenuText RECORDS to
attach a menu bar to a custom window, delay for 10 seconds, and then close
down. Touch the right mouse button during execution to see the menu bar.
Contrast this approach with F-Basic's high level interface, as demonstrated
in GfxsTest18.

    56. LikeC2 - This program uses calls to the DOS library to examine the
information on the disk about any file. As an example, input FB, and the
information about the FastCom compiler (file FB) is displayed.

    57. LikeC3 - This program directly accesses the Amiga's Sound library
functions and audio device to play a sine wave with a variable number of
points a variable number of times. Example input:  1000, 150, 20.

    58. LikeC4 - This program uses direct calls to the translator library
and the narrator device to "speak" the contents of a file. Enter a file
name, and it reads the file to you. Example input: F-Basic.Example.

    59. LikeC5 - This program directly uses the blitter to move an orange
box from one area of a custom window to another.

    60. LikeC6 - Like the program LikeC5, except the blitter is directly
employed to move an image from one custom window to another.

    61. LikeC7 - This program uses direct ROM library calls to sense input
events after opening 2 windows and attaching 2 menus. The events detected
are Menu Selection, Mouse Clicks, and Close Window Clicks. After each input
event, the user is given the option to either terminate or continue.

    62. LinkedList - This program demonstrates F-Basic RECORD and PTR_TO
(pointer) structures by constructing and maintaining a linked list of
integers. The operations supported include adding to, deleting from, and
erasing the linked list, as well as stopping the program. The command
"erase" should be executed before "stopping" to guarantee that all free
memory is returned to the operating system.

    63. MixedArith1 - A demonstration of F-Basic's mixed mode arithmetic is
presented. The correct output is listed in the program's header block.

    64. MixedArith2 - A further demonstration of F-Basic's mixed mode
arithmetic capabilities. The correct output is again listed in the program's
header block.

    65. Pelican.Source - This program demonstrates the IFF file capabilities
of F-Basic2.0. It reads and displays the file ArtGallery/Pelican.Info. To
terminate, strike any key.

    66. RealArray1 - This program demonstrates F-Basic's real array
capabilities by sorting a reverse-filled array. The correct output is 1.0
through 20.0.

    67. Serial_Port - This program demonstrates F-Basic's ability to
interact with the serial port. Using ROM Kernel calls, it opens,
initializes, and activates the serial port for both reading and writing.

    68. Shade Select - This program is based on an AmigaBasic example from
Ahoy!'s AmigaUser written by Tom Giffin. It was converted to F-Basic by DNS,
Inc. The program allows the user to select any of the 4096 shades of color
produced by the Amiga and display ten of them on the screen at once for
comparison purposes.

    69. Sound1 - This program demonstrates F-Basic's high level sound
facilities. The musical scale is played five times. First the F-Basic TONE
function is used. Next, using the WAVE statement, the scale is played for a
sawtooth wave, then a square wave, then a sine wave, and finally, for a
"noise" wave.

    70. TextFunctions - Demonstrates F-Basic's ability to support functions
of type TEXT. Concatenation and substring references of them are also
included. The correct output is listed in the program header block.

    71. TextSort - This program demonstrates F-Basic's TXTSORT function. It
randomly fills a character array and then sorts the elements. An input for
the number of elements desired by the user is accepted (maximum = 100
elements for this program).

    72. Time - Program converts DateStamp returned by F-Basic's DOSTIME
function to time of day, e.g. xx:xx:xx AM or xx:xx:xx PM


        Most of the following timing tests were taken from Amiga
publications where other language systems were discussed. The published
programs were converted to F-Basic and then timed using the system's timer,
as accessed by F-Basic's DOSTIME function. Where applicable, a reference to
the original article is given in the header block of the program.

    73. TimingTest1 - A prime program published in Amazing Computing, Volume
1, #6, page 6.

    74. TimingTest2 - Another prime program published in Amazing Computing,
Volume 1, #9, page 114.

    75. TimingTest3 - A sieve program using a WHILE control structure.
Published in Amazing Computing, Volume 1, #9, page 114. Ten passes are
timed.

    76. TimingTest4 - Another version of the sieve program using a FOR loop
control structure. Published in Amazing Computing, Volume 1, #9, page 114.
Ten passes are timed.

    77. TimingTest5 - An optimized sieve program demonstrating F-Basic's
address (@) and indirect reference (^) operators. This is a slight
modification from programs TimingTest3 and TimingTest4, and is timed for 10
passes through the algorithm.

    78. TimingTest6 - Savage benchmark as published in Amazing Computing,
Volume 2, #4, page 8.

    79. TimingTest7 - Benchmark timing test displayed in Amazing Computing,
Volume 1, #9, page 79.

    80. TimingTest8 - Benchmark timing test as shown in Amazing Computing,
Volume 1, #9, page 79, except F-Basic's REAL FOR loops are utilized.

    81. TimingTest9 - Same benchmark timing test as TimingTest8, except that
F-Basic's INTEGER FOR loops are used.

    82. TimingTest10 - Float timing test displayed in Amazing Computing,
Volume 2, #8, page 75.

    83. TimingTest11 - BYTE Calculations program, as presented in Amazing
Computing, Volume 2, #8, page 75.

    84. TimingTest12 - WriteToDisk timing test presented in BYTE, Fall,
1985, page 200.

    85. TimingTest13 - ReadFromDisk timing test presented in BYTE, Fall,
1985, page 200. Uses the file created by first running TimingTest12.

    86. TimingTest14 - Timing test consists of sorting a randomly filled
10000 element INTEGER array using F-Basic's INTSORT library routine. Due to
limited space on the F-Basic system disk, the object file created by the
compiler for this program should be directed to a different disk. For
example, assuming again a two floppy drive system with the Sample Programs
disk in drive df1:, one could invoke the compiler with:

                   1>FB df1:TimingTest14 df1:test.bin

This will produce the object file in a file named test.bin on the first
external drive.

    87. TimingTest15 - Timing test consists of sorting a randomly filled
TEXT*5 array of 10000 elements using F-Basic's TXTSORT library function.
Again, as with TimingTest14, the object file should be directed away from
the F-Basic system disk. Additionally, the -o option, as explained in
Chapter 1, should be utilized to successfully compile the program, due to
its large data storage requirements.

    88. ZTest1 - This program accepts as input N and K, the respective
beginning and ending elements of an array to be sorted by the Merge-Sort
algorithm. It first sorts the array with the elements in reverse order,
printing out the number of compares. It then performs 100 sorts (randomly
mixing up the array each time) and prints the average number of compares
made over the 100 trials.

NOTE:  This program is not for the squeemish as direct manipulation of
operating system memory and data structures is used to effect the visual
displays. F-Basic's &SYSLIB interface is also used for direct ROM Kernel
routine calls.

Direct Assembly Code is utilized by using F-Basic's INSERT statement.

Example Input: 100 and then 200

As with programs TimingTest14 and TimingTest15, the object file for this
program should be directed away from the F-Basic's system disk.

    89. ZTest2 - Program written by Neal Countryman to visually compare the
performance of the Brute Force Search, Binary Search, and Modified Binary
Search algorithms on an ordered list of 1793 elements. 1000 trials of the
respective techniques are used on a randomly generated target, and the
number of integer compares with array elements (and thus, the effective
speed of the algorithms) are tabulated and displayed by the program in a
unique way. Requires the presence of the file DS1.Screen on the F-Basic
Sample Programs disk (assumed to be in df1: ). This is an IFF file used by
the program.

NOTE:  This program is not for the squeemish as direct manipulation of
operating system memory and data structures is used to effect the visual
displays.

Upon execution, the program can be "started" by moving the mouse to the
on/off switch in the upper right corner of the display and clicking on it.
To start any of the three timing tests, the mouse should be moved to the
respective start box at the bottom of the screen and clicked on the
appropriate choice. To end the program, reposition the mouse to the on/off
switch in the upper right corner and click on it.

The visual rendering of the Binary Search and Modified Binary Search are not
as dynamic as that of the Brute Force Search algorithm, but illustrates how
much better these algorithms are in terms of number of compares.

As with programs TimingTest14, TimingTest15, and ZTest1, the object file for
this program should be directed away from the F-Basic system disk.



    






   








