››;›; SHARP SHOOTER›; by Matthew J.W. Ratcliff ›;›; COPYRIGHT 1989›; BY ANALOG COMPUTING›;›››; CHECKSUM DATA›;[48 0B 1E 62 0B 10 10 12 ›; 78 1A 5B 6E 9E 58 23 EE ›; D8 EB E2 41 52 46 14 71 ›; 0B 3A 83 1F A4 53 18 ]››BYTE RTS=[$60] ; This declaration › ; must be the first› ; compiled code if › ; using this pgm with› ; OS/A+ versions 2.2› ; and before››; Game global target array››BYTE ARRAY XCS=[26 79 132 26 79 132]›BYTE ARRAY YCS=[48 48 48 144 144 144]›BYTE ARRAY Tgsel(6)››BYTE Jiffy = 20›BYTE Jiffy1 = 19›BYTE CH = 764›BYTE TRIGGER= 632›BYTE Attract= 77››;-------------------------›INCLUDE "D:GUNREAD.ACT"›;-------------------------››PROC ZeroTime()››CARD Timer=19››Timer = 0››RETURN››;-------------------------›; Get elapsed time in jiffies›;›CARD FUNC GetJTime()››CARD tic››tic = Jiffy1*256 + Jiffy ››RETURN(tic)›;-------------------------›PROC Blast( CARD xb, BYTE yb )››BYTE s›CARD d››Attract = 0››IF xb < 1 THEN › xb = 1›FI››IF xb >158 THEN› xb = 158›FI››IF yb < 1 THEN› yb = 1›FI››IF yb > 190 THEN› yb = 190›FI››Plot(xb-1, yb)›Plot(xb+1, yb)›Plot(xb, yb-1)›Plot(xb, yb+1)››s = 16 ›Sound(0, 100, 8, 15)››FOR d = 0 TO 200› DO› ;› OD››WHILE s # 0› DO› s = s - 1› Sound(0, 140, 8, s)› FOR d = 0 TO 100› DO› ;› OD› OD››Sound(0, 0, 0, 0)››RETURN ››;-------------------------›; Return the integer square›; ROOT of the value passed.›;›; Algorithm: The integer square ›; root is the count of the total›; successive odd numbers, starting›; from 1, that can be subtracted›; from the parameter before it goes›; negative.››BYTE FUNC ISqrt( INT r )››BYTE i, j››i = 1›j = 0›WHILE (r > 0)› DO› r = r - i› i = i + 2› IF r >= 0 THEN› j = j + 1› FI› OD››RETURN( j )››;-------------------------››PROC SelTarget( BYTE tg )››CARD X›BYTE y››Attract = 0››x = XCS(tg)›y = YCS(tg) ››Plot(x-26,y-26)›DrawTo(x+26,y-26)›DrawTo(x+26,y+26)›DrawTo(x-26,y+26)›DrawTo(x-26,y-26)››IF color # 0 THEN› FOR y = 0 TO 15› DO› Sound(0, 60, 10, y)› FOR x = 0 TO 200› DO› ;› OD› OD › Sound(0, 0, 0, 0)› FI››RETURN››;-------------------------››INT FUNC ABS(INT NUMBER)››IF (NUMBER < 0) THEN› RETURN(-NUMBER)›FI›RETURN(NUMBER)››;---------------------------››PROC GAMESCREEN()››BYTE I,R›INT DX›INT DY›INT PHI, PHIXY, PHIY››CARD X›BYTE Y››Attract = 0›color = 1››FOR R=5 TO 25 STEP 5› DO› DX=R› DY=0› PHI = 0› WHILE DX >= DY › DO› PHIY = PHI+DY+DY+1› PHIXY= PHIY-DX-DX+1› X = DX› Y = DY› FOR I=0 TO 5› DO› Plot (XCS(I)+X,YCS(I)+Y)› Plot (XCS(I)+Y,YCS(I)+X)› Plot (XCS(I)+Y,YCS(I)-X)› Plot (XCS(I)+X,YCS(I)-Y)› Plot (XCS(I)-X,YCS(I)-Y)› Plot (XCS(I)-Y,YCS(I)-X)› Plot (XCS(I)-Y,YCS(I)+X)› Plot (XCS(I)-X,YCS(I)+Y)› OD› PHI = PHIY› DY = DY + 1› IF ABS(PHIXY)+0 3 THEN› color = 1› FI› Blast( x, y )› radius = GetRadius(x,y,tgsel(i))› IF radius <= 5 THEN› bulls = bulls + 1› BingBong()› FI› IF radius <= 25 THEN› hits = hits + 1› score = score + (26-radius)› ELSE› misses = misses + 1› BingBap()› FI› DO› UNTIL TRIGGER=14› OD› color = 0› SelTarget( tgsel(i))› i = i + 1› IF i > 5 THEN› i = 0› RandTgts()› FI› color = Rand(3) + 1› OD› OD› x = GetJTime()› x = x/60› IF x < 3600 THEN› x = 3600/x› ELSE› x = 0› FI› CH = 255› Graphics(0) › Poke (710, 20)› Position(2,2)› PrintE("Sharp Shooter By Mat*Rat")› Print("Final Score for Round ")› PrintCE( round )› round = round + 1› Print("Bullets/Min = ")› PrintCE( x )› Print("Total Hits = ")› PrintCE( hits )› Print("Total Misses = ")› PrintCE( misses )› Print("Bullseyes = ")› PrintBE( bulls )› Print("Score = ")› PrintCE( score )› IF score > hiscore THEN› hiscore = score› FI› Print("Accuracy = ")› x = 100 * bulls› x = x/60› IF x > hipct THEN› hipct = x› FI› PrintC( x )› PrintE("%")› PrintE("")› Print("High Score = ")› PrintCE( hiscore )› Print("Best Accuracy= ")› PrintB( hipct )› PrintE("%")› PrintE("")› PrintE("Press Ôòéççåò  to play")› PrintE("Or type ÅÓÃÁÐÅ  to exit")› DO› UNTIL TRIGGER=14 OR CH=28› OD› DO › UNTIL TRIGGER=15 OR CH=28› OD› DO› UNTIL TRIGGER=14 OR CH=28› OD››UNTIL (CH = 28)›OD››CH=255›Graphics(0)›PrintE("Sharp Shooter, by Mat*Rat")›PrintE("(c) 1989, Analog Computing")›RETURN››