DECLARE SUB drawit ()
DECLARE SUB plotit ()
DECLARE FUNCTION MouseInit% ()
COMMON SHARED nodes
COMMON SHARED nx, ny, num
DIM SHARED Mouse$
nodes = 2000
DIM SHARED nx(1 TO nodes)
DIM SHARED ny(1 TO nodes)
DIM SHARED BSV$
TYPE sammy
x AS INTEGER
y AS INTEGER
END TYPE
10 CLS
SCREEN 12
LOCATE 1, 1: LINE INPUT "Metafilename-->"; file$
LOCATE 2, 1: LINE INPUT "BSV File-->"; BSV$
OPEN file$ FOR INPUT AS #1 LEN = nodes
plotit
drawit

SUB drawit
DIM fs(1 TO nodes)
DIM f(1 TO nodes)
CLS
steps = 20
FOR gh% = 1 TO num
fs(gh%) = ny(gh%) / steps
NEXT gh%
FOR fi% = 1 TO steps * 2
FOR gh% = 1 TO num
f(gh%) = f(gh%) + fs(gh%)
NEXT gh%
FOR rt% = 1 TO num - 1
tx = nx(rt%): ty = (240 - ny(rt%)) + f(rt%)
tx2 = nx(rt% + 1): ty2 = (240 - ny(rt%)) + f(rt%)
IF (tx - tx2) + (ty - ty2) > -13 THEN clr% = 8
IF (tx - tx2) + (ty - ty2) > -6 THEN clr% = 7
IF (tx - tx2) + (ty - ty2) > 0 THEN clr% = 15
LINE (tx, ty)-(tx2, ty2), (tx + ty2) - (ty + tx2)
NEXT rt%
NEXT fi%
IF BSV$ = "" THEN  ELSE BSAVE BSV$, 0, 65534
END SUB

SUB plotit
CLS : SCREEN 12
LOCATE 1, 1: PRINT "Loading & Decoding..."
loops:
FOR yi = 1 TO 100 STEP .6: NEXT yi
DO
IF nd% = 1 THEN GOTO dones
GOTO pute
LOOP
pute:
yu% = yu% + 1
IF EOF(1) THEN nd% = 1 ELSE INPUT #1, x%, y%
nx(yu%) = x%: ny(yu%) = 480 - y%
CIRCLE (x%, y%), 1, 2
GOTO loops
dones:
num = yu%
CLOSE 1
LOCATE 1, 1: PRINT "                    "
END SUB

