brolsma@BBN-SPCA.ARPA (11/24/85)
From: Bruce Brolsma <brolsma@BBN-SPCA.ARPA> Believe me, I know the problems of getting a manual out under the pressure of deadlines, and I'm sure the AbasiC manual had a tight one (the Errata sheets attest to that)... Since there are some folks who don't have the Lattice C compiler and don't program in C, thought I'd include a few AbasiC listings of the type I'd have liked to see in the manual; short, complete programs that exercise various some of the neat features of the Amiga. Short, complete programs can help those who haven't mastered the various parts of AbasiC into a cohesive whole; after all, there are some pretty non-standard BASIC statements here; there have to be, to take advantage of Amiga's capabilities... Have fun! ------------------------ cut here -------------------------------------- 100 REM exercise color registers. 200 screen 1,4,0 300 font 0 400 graphic(0): print at (30,1); "Basic Register Colors" 500 n = 0: REM initialize pen color 600 rad = 15 700 y1 = -15 800 for j = 1 to 2: REM print two rows of circles 900 y1 = y1 + 50 1000 x1 = -30 1100 for i = 1 to 8 : REM print eight circles per row 1200 x1 = x1 + 70 1300 circle (x1,y1), rad 1400 n = n + 1 1500 PENA n 1600 PAINT (x1,y1), 1: REM fill circle with color and number it 1700 graphic(-1): print at (x1 - 10, y1); n 1800 next i 1900 next j ------------------------------------- cut here ------------------------ 10 REM Practice phonetic spelling with this loop. CTRL-C twice to end. 20 audio 15, 1 30 line input "Enter line to speak: "; i$ 40 a$ = translate$ (i$) 50 x% = narrate(a$) 60 goto 30 ------------------------------------- cut here ------------------------- 10 REM Exercise mouse coordinate location feature. 20 PENA 3 30 FONT 0 40 print at (10,1) "Mouse location practice." 50 print at (50,2) " x1 y1" 60 count = 1 70 while(1) 80 ASK MOUSE x1%, y1%, lpush% 90 print at (50,1) x1%, y1%; 95 REM Normally, you'd branch off here once you've detected that 96 REM mouse button has been pushed, to do some task... 97 REM SLEEP is necessary because of speed of the loop. 100 if lpush% = 4 then count = count + 1: sleep .5*10^6 ELSE goto 80 110 if (count > 10) then PRINT "DONE": END 120 wend