%%HP: T(3)A(D)F(.);
@ SILO by Virgil Wall, Jr.
DIR
  SILO
    \<<
GROB 9 7 0000000000000000000001000100
GROB 9 7 0000000000000100830001000100
GROB 9 7 000000008300C700830001000100
GROB 9 7 0100C700EF00EF00830001008300
GROB 9 7 8300C700EF00FF10931001008300
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 \-> E1 E2
E3 E4 E5 I A V T LX
LY RX RY HL HR HX
HY CA SA PX PY X Y
G M W WW LA0 LV0
LA1 LV1
      \<< CLEAR {
# 0h # 0h } PVIEW
RAND 2 / .25 - 2
RND 'W' STO 63 RAND
40 * - FLOOR 'LY'
STO 63 RAND 40 * -
FLOOR 'RY' STO RAND
50 * 5 + FLOOR 'LX'
STO 125 RAND 50 * -
CEIL 'RX' STO LX
RAND 60 LX - * + 5
+ 'HL' STO RX RAND
RX 70 - * - 5 -
'HR' STO HL RAND HR
HL - * + 'HX' STO
10 RAND 30 * + 'HY'
STO LX LY RX RY HL
HR HX HY W MAP 0
WAIT RAND 2 * FLOOR
'T' STO
        DO
          IF T 1 ==
          THEN 0
'T' STO
          ELSE 1
'T' STO
          END
          IF T 0 ==
          THEN LX
'X' STO LY 'Y' STO
          ELSE RX
'X' STO RY 'Y' STO
          END
          IF T 0 ==
          THEN LA0
          ELSE LA1
          END
          IF T 0 ==
          THEN
"PLAYER 1 Angle ("
LA0 \->STR + ")" +
          ELSE
"PLAYER 2 Angle ("
LA1 \->STR + ")" +
          END ""
INPUT OBJ\-> 'A' STO
          IF T 1 ==
          THEN 180
A - 'A' STO
          END
          DO
            IF T 0
==
            THEN
LV0
            ELSE
LV1
            END
            IF T 0
==
            THEN
"(1-50)Velocity ("
LV0 \->STR + ")" +
            ELSE
"(1-50)Velocity ("
LV1 \->STR + ")" +
            END ""
INPUT OBJ\-> 'V' STO
          UNTIL V
50 \<= V 1 \>= AND
          END
          IF T 0 ==
          THEN A
'LA0' STO V 'LV0'
STO
          ELSE 180
A - 'LA1' STO V
'LV1' STO
          END 0
'PX' STO 0 'PY' STO
0 'G' STO 0 'M' STO
0 'WW' STO CLEAR LX
LY RX RY HL HR HX
HY W MAP { # 0h
# 0h } PVIEW A COS
V * 'CA' STO A SIN
V * 'SA' STO 523
.02 BEEP 1046 .02
BEEP
          DO
            IF KEY
0 \=/
            THEN 1
'M' STO
            END W
'WW' STO+ 'X' CA WW
+ V / 4 * STO+ 1
'G' STO+ 'Y' SA G -
V / 4 * STO-
            IF X 0
< X 130 > OR
            THEN 1
'M' STO
            END
            IF X HR
> Y RY \>= AND
            THEN 1
'M' STO 300 .05
BEEP
            END
            IF X HL
< Y LY \>= AND
            THEN 1
'M' STO 300 .05
BEEP
            END
            IF X HL
\>= X HX \<= AND Y LY
LY HY - HX HL - / X
HL - * - \>= AND
            THEN 1
'M' STO 300 .05
BEEP
            END
            IF X HR
\<= X HX \>= AND Y RY
RY HY - HR HX - /
HR X - * - \>= AND
            THEN 1
'M' STO 300 .05
BEEP
            END
            IF Y RY
\>= RX X - ABS 2 \<=
AND
            THEN 2
'M' STO
            END
            IF Y LY
\>= LX X - ABS 2 \<=
AND
            THEN 3
'M' STO
            END
            IF X 0
> X 130 < AND Y 0 >
AND
            THEN X
R\->B Y R\->B 2 \->LIST
PIXON
            END
          UNTIL M 0
\=/
          END
          IF M 1 ==
          THEN 0
WAIT
          END
          IF M 2 ==
          THEN
CLEAR 1 5
            FOR I
PICT RX 4 - R\->B RY
7 - R\->B 2 \->LIST "E"
I \->STR + OBJ\-> GOR
.06 WAIT
            NEXT
HORN 0 WAIT DROP
          END
          IF M 3 ==
          THEN
CLEAR 1 5
            FOR I
PICT LX 4 - R\->B LY
7 - R\->B 2 \->LIST "E"
I \->STR + OBJ\-> GOR
.06 WAIT
            NEXT
HORN 0 WAIT DROP
          END
        UNTIL M 2
== M 3 == OR
        END
      \>>
    \>>
  MAP
    \<< 0 \-> LX LY RX
RY HL HR HX HY W I
      \<< ERASE # 0h
LY R\->B 2 \->LIST HL
R\->B LY R\->B 2 \->LIST
LINE # 82h RY R\->B 2
\->LIST HR R\->B RY R\->B
2 \->LIST LINE HL R\->B
LY R\->B 2 \->LIST HX
R\->B HY R\->B 2 \->LIST
LINE HR R\->B RY R\->B
2 \->LIST HX R\->B HY
R\->B 2 \->LIST LINE LX
2 - R\->B LY 1 + R\->B
2 \->LIST LX 2 + R\->B
# 3Fh 2 \->LIST BOX
RX 2 - R\->B RY 1 +
R\->B 2 \->LIST RX 2 +
R\->B # 3Fh 2 \->LIST
BOX PICT { # 0h
# 0h } "WIND=" W 50
* \->STR + 1 \->GROB
GOR
      \>>
    \>>
  HORN
    \<< 523.25 .25
BEEP 698.46 .25
BEEP 880 .09 BEEP
698.46 .1 BEEP
523.25 .25 BEEP 880
.25 BEEP 698.46 .25
BEEP 880 .09 BEEP
698.46 .1 BEEP
523.25 .25 BEEP 880
.25 BEEP 698.46 .25
BEEP 880 .09 BEEP
698.46 .1 BEEP
523.25 .25 BEEP
523.25 .3 BEEP
698.46 .3 BEEP
    \>>
END
