# PATC.bas

new

draw -1



# set variables

intercept$=chr$(141)

jet$=chr$(149)

fl$="SW718"

alt$="050"

spd$=" 230" '

dt2$=alt$+spd$ ' data tag

pi=3.14159265359

t=0 ' initialize screen tapping

r=1 ' initialize y modifier

h=45

xo=1:yo=1 ' initialize x,y modifiers

sec$=mid$(time$,6,1)

sec=asc(sec$)



if sec<5 then dt$=fl$

if sec>5 then dt$=alt$



# screen limits variables

xl=7 : xr=147

yt=22 :yb=117

x=80:y=80



top:



while



# wait for stylus tap

a=fn 17



#draw border

draw 5,20,155,20,1

draw 5,20,5,140,1

draw 5,140,155,140,1

draw 155,20,155,140,1



# draw time

time$=fn time$(0)

draw time$,120,1



x=x+xo : y=y+yo



# draw sweep



draw xl,yt,xr,yb,-7



for sw=8 to 154 step 6

	gosub videomap()

	draw 80,80,sw,21,1

	draw 80,80,sw,21,-1

next sw



for sw=24 to 135 step 6

	gosub videomap()

	draw 80,80,154,sw,1

	draw 80,80,154,sw,-1

next sw



for sw=154 to 8 step -6

	gosub videomap()

	draw 80,80,sw,138,1

	draw 80,80,sw,138,-1

next sw



for sw=135 to 24 step -6

	gosub videomap()

	draw 80,80,6,sw,1

	draw 80,80,6,sw,-1

next sw



t=fn 34

if t>a then goto command:



wend



command:



# remember h in case bad input

hh=h

 

# get command

input "Command:",c$



if c$="" then goto command

if c$="fh" then goto flyheading

if c$="trh" then goto turnright

if c$="tlh" then goto turnleft

if c$="cm" then goto climbto

if c$="dm" then goto descendto

if c$="cl" then goto cleartoland



flyheading:

input "Heading:",h$

h=val(h$)

if h$="" then goto badheading

if h<0 or h>360 then goto badheading



if h>-1 and h<45 then goto h45

if h>=45 and h<90 then goto h90

if h>=90 and h<135 then goto h135

if h>=135 and h<180 then goto h180

if h>=180 and h<225 then goto h225

if h>=225 and h<270 then goto h270

if h>=270 and h<315 then goto h315

if h>=315 and h<360 then goto h360





h45:

	m=tan(h*pi/180)

	xo=m

	yo=-1

goto top



h90:

	h=h-45

	m=tan(h*pi/180)

	m=m-1

	xo=1

	yo=m

goto top



h135:

	h=h-90

	m=tan(h*pi/180)

	xo=1

	yo=m

goto top



h180:

	h=h-135

	m=tan(h*pi/180)

	m=m-1

	xo=-m

	yo=1

goto top



h225:

	h=h-180

	m=tan(-h*pi/180)

	xo=m

	yo=1

goto top



h270:

	h=h-225

	m=tan(h*pi/180)

	m=m-1

	xo=-1

	yo=-m

goto top



h315:

	h=h-270

	m=tan(-h*pi/180)

	xo=-1

	yo=m

goto top



h360:

	h=h-315

	m=tan(h*pi/180)

	m=m-1

	xo=m

	yo=-1

goto top



badheading:

print "Enter heading between 0° to 360°"

h=hh



goto top



end



sub videomap()

	draw jet$,x,y

	draw dt$,x+6,y-6

	draw 70,90,100,90,1

	draw 70,94,100,94,1

	draw "Banyo",50,22

	draw intercept$,40,22

	draw "BXK",18,120

	draw intercept$,8,120

return

    Source: geocities.com/greenchile505