10	JJJ = 0
20	WIDTH 255
30	DEFSTR A-H,O-W
40	DEFINT I,J,K,L,X,Y,Z
50	DEFSNG M,N
60	X = 0
70	Y = 0
80	ALT = CHR$(27)+"S"+CHR$(0)+CHR$(85): REM SCREEN TO COLUMN 53, ROW 0
90	REG = CHR$(27)+"S"+CHR$(0)+CHR$(25): REM SCREEN TO COLUMN 7, ROW 0
100	CL1 = CHR$(26)+CHR$(27)+"S"+CHR$(0)+CHR$(32): REM CLEAR SCREEN AND SET TO COLUMN 0, ROW 0
110	CLS = CHR$(26)+CHR$(27)+"S"+CHR$(0)+CHR$(25): REM CLEAR SCREEN AND SET TO COLUMN 7, ROW 0
120	G1  = CHR$(27)+"g": REM TURN GRAPHICS ON
124	PRINT
130	G0  = CHR$(27)+"G": REM TURN GRAPHICS OFF
140	U1  = CHR$(27)+"1": REM TURN UNDERLINING ON
150	U0  = CHR$(27)+"m": REM TURN UNDERLINING OFF
160	H1  = CHR$(27)+")": REM TURN HALF INTENSITY DISPLAY ON
170	H0  = CHR$(27)+"(": REM TURN HALF INTENSITY DISPLAY OFF
180	CURSORMOVE = CHR$(27)+"="+CHR$(Y)+CHR$(X+32): REM MOVES CURSOR TO POSITION X,Y
190	DEF FNCM$(X%,Y%) = CHR$(27) + "S" + CHR$(Y%) + CHR$ (X%+32)   ' moves cursor to position X%,Y%
200	CURSORLEFT = CHR$(8): REM CURSOR LEFT w/o ERASE
210	CURSORRIGHT= CHR$(12): REM CURSOR RIGHT w/o ERASE
220	DEL1= CHR$(27)+"W": REM DELETE CHARACTER AT CURSOR POSITION
230	CURSORUP   = CHR$(11)
240	CURSORDOWN = CHR$(10)
250	RTN = CHR$(13)
260	INSERT$ = CHR$(27)+"Q": REM INSERTS CHARACTER AT CURSOR POSSTION
270	INSERTLINE$ = CHR$(27)+"E": REM INSERT LINE AT CURSOR LINE
280	X(0)=0
290	X(1)=6
300	X(2)=16
310	X(3)=26
320	X(4)=6
330     X(5)=16
340	X(6)=26
350	X(7)=6
360	X(8)=16
370	X(9)=26
380	Y(0)=0
390	Y(1)=17
400	Y(2)=17
410	Y(3)=17
420	Y(4)=10
430	Y(5)=10
440	Y(6)=10
450	Y(7)=3
460	Y(8)=3
470	Y(9)=3
480	ACE% = 9999
490	PRINT CLS; 
500	PRINT:PRINT:PRINT:PRINT:PRINT
510	PRINT "    THIS IS THE BLACK HOLE GAME"
580	PRINT "DO YOU WANT INSTRUCTIONS? (Y or N)?";
590	E$ = INKEY$: IF E$ = "" THEN 590
600	IF E$ = "Y" OR E$ = "y" THEN GOTO  1750
610	REM RESTART VECTOR
620	PRINT CLS;
630	LET GALAXY%=2^5
640	LET GALAXY2%=2^5
650	LET NS% = 0
660	REM
670	FOR H% = 0 TO 8
680     LET JJ = 9-H%
690	SUN1% = GALAXY% AND (2^JJ)
700	SUN2% = GALAXY2% AND (2^JJ)
710	HOLE1%=	(GALAXY% AND (2^JJ)) = 0
720	HOLE2%=	(GALAXY2% AND (2^JJ)) = 0
730	IF (HOLE1% AND SUN2%) OR (HOLE1% AND NS%=0) OR (HOLE1% AND NN% = 0) THEN GOSUB 2920
740	IF (SUN1% AND HOLE2%) OR (SUN1% AND NS% = 0) OR (SUN1% AND NN% = 0) THEN GOSUB 2640
750	NEXT H%
760	NN% =1
770	IF NOT GALAXY%  = 0 THEN GOTO 810
780	GOSUB 1690
790	GOSUB 1690
800	GOTO 1210:'call LOSE
810	IF NOT GALAXY% = 990 THEN GOTO 850
820	GOSUB 1690
830	GOSUB 1690
840	GOTO 1410: REM CALL 'WIN'
850     REM IF ACE%<>9999 THEN PRINT "BEST SCORE: ";ACE%;
860	JJ=0:L=0
870	GOSUB 2870
880	PRINT CRSR;
885	PRINT "      SCORE TO BEAT :     ";ACE%
890	PRINT "     ";NS%;" SHOTS  --   WHICH STAR?";
900	STAR$  = INKEY$ : IF STAR$  = "" THEN 900 
920	NS% = NS% + 1
930	STAR% = VAL(STAR$)
940	IF STAR$ = "0" THEN GOTO  1750
950	IF STAR%  < 1 OR STAR% > 9 THEN GOTO 900
960	IF (GALAXY% AND 2^STAR%) = 0 THEN  GOTO 900
970	GALAXY2% = GALAXY%
980	ON STAR% GOSUB 1020,1040,1060,1080,1100,1120,1140,1160,1180
990	LET GALAXY% = (GALAXY% OR CHANGE%) AND NOT (GALAXY% AND CHANGE%)
1000	GOTO 660
1010	REM----------------------------------------
1020	LET CHANGE% = 54
1030	RETURN
1040	LET CHANGE% = 14
1050	RETURN
1060	LET CHANGE% = 108
1070	RETURN
1080	LET CHANGE% = 146
1090	RETURN
1100	LET CHANGE% = 372
1110	RETURN
1120	LET CHANGE% = 584
1130	RETURN
1140	LET CHANGE% = 432
1150	RETURN
1160	LET CHANGE% = 896
1170	RETURN
1180	LET CHANGE% = 864
1190	RETURN
1200	REM----------------------------------------
1210    REM ROUTINE "LOSE"	
1220	JJ=0:L=0
1230	GOSUB 2870
1240	PRINT CRSR;
1245	PRINT
1250	PRINT "   * YOU ARE LOST IN SPACE FOREVER *                             ";  
1260	GOSUB 1690
1270	FOR J% = 1 TO 25
1280	PRINT ALT$;
1290	GOSUB 1690
1300	PRINT REG$;
1310	GOSUB 1690
1320	NEXT J%
1330	NS% = 0
1340	PRINT CLS;
1350	PRINT "WANT TO TRY AGAIN? (Y or N)?";
1360	CC$ = INKEY$: IF CC$ = "" THEN 1360
1370	IF CC$ = "Y" OR  CC$ = "y" THEN PRINT CLS;: GOTO 610
1380	PRINT CL1;"BACK TO MBASIC";
1390	END
1400	REM----------------------------------------
1410	REM ROUTINE "WIN"
1420	GOSUB 1690
1430	PRINT CLS$
1440	PRINT:PRINT:PRINT:PRINT:PRINT:
1450	PRINT "***********************************"
1460    PRINT "***********************************"
1470    PRINT "**                               **"
1480	PRINT "**        CONGRATULATIONS        **"
1490	PRINT "** YOU HAVE FOUND THE BLACK HOLE **"
1500    PRINT "**                               **"
1510	PRINT "***********************************"
1520    PRINT "***********************************"
1530	PRINT
1540    PRINT "##########  ";NS%;" SHOTS   ##########"
1550	FOR J% = 1 TO 25
1560	GOSUB 1690
1570	PRINT ALT$;
1580	GOSUB 1690
1590	PRINT REG$;
1600	NEXT J%
1610	IF NS% < ACE% AND ACE% = 9999 THEN PRINT "YOU ARE THE NEW ACE": ACE%=NS%: GOTO 1640
1620	IF NS% < ACE% THEN PRINT "YOU ARE THE NEW ACE BY ";ACE%-NS%;" SHOTS!":ACE%=NS%
1640	PRINT "WANT TO TRY AGAIN? (Y or N)?";
1650	CC$ = INKEY$: IF CC$ = "" THEN 1650
1660	IF CC$ = "Y" OR  CC$ = "y" THEN PRINT CLS: GOTO 610
1670	GOTO 1380
1680	REM----------------------------------------
1690	REM SUBROUTINE FOR FLASH DELAY
1700	FLASH% = 80
1710	FOR I% = 1 TO FLASH%
1720	NEXT I%
1730	RETURN
1740	REM----------------------------------
1750	REM SUBROUTINE 'INSTRUCTIONS'
1760	PRINT CL1$;
1770	PRINT "THE OBJECT OF THE BLACK HOLE GAME IS  TO"
1780	PRINT "START WITH A PATTERN LIKE 'A' AND TURN IT"
1790	PRINT "INTO 'B' WITH THE CORRECT SHOTS, WITHOUTH"
1800	PRINT "GETTING THE 'C' PATTERN"
1810	PRINT
1820	PRINT "     A               B             C "
1830	PRINT
1840	PRINT "   o o o           * * *         o o o "
1850	PRINT
1860	PRINT "   o * o           * o *         o o o "
1870	PRINT
1880	PRINT "   o o o           * * *         o o o "
1890	PRINT
1900	PRINT "PRESS ANY KEY TO CONTINUE OR 'RETURN' FOR GAME"
1910	E$ = INKEY$: IF E$ = "" THEN 1910
1920	IF E$ = CHR$(13) THEN GOTO 2590
1930	PRINT CL1$;
1940	PRINT "IN THE BLACK HOLE GAME, YOU ARE ALLOWED TO SHOOT"
1950	PRINT "AT STARS BUT NOT AT HOLES.  THREE DIFFERENT "
1960	PRINT "TYPES OF SHOTS ARE AVAILABLE: "
1970	PRINT:PRINT
1980	PRINT "1	CENTER SHOT"
1990	PRINT "2	SIDE SHOT"
2000	PRINT "3	CORNER SHOT"
2010	PRINT
2020	PRINT "THE OTHER POSITIONS ARE REVERSED ACCORDING "
2030	PRINT "TO THE PATTERN OF THE TYPE OF SHOT"
2040	PRINT
2050	PRINT
2060	PRINT "PRESS ANY KEY TO CONTINUE OR 'RETURN' FOR GAME:"
2070	E$ = INKEY$: IF E$ = "" THEN 2070
2080	IF E$ = CHR$(13) THEN GOTO 2590
2090	PRINT CL1$;
2100	PRINT "      THE  CENTER  SHOT "
2110	PRINT
2120	PRINT "SHOOTING THE CENTER STAR CAUSES THE CENTER AND ALL"
2130	PRINT "EDGE POSITIONS TO CHANGE TYPE (i.e. to change from"
2140	PRINT "a hole to a star or vice-versa"
2150	PRINT
2160	PRINT "EXAMPLES: ('X' INDICATES STAR SHOT AT)"
2170	PRINT
2180	PRINT " * * *     * o *          o o o     o * o"
2190	PRINT
2200	PRINT " * X *  =  o o o          o X o  =  * * *"
2210	PRINT
2220	PRINT " * * *     * o *          o o o     o * o"
2230	PRINT 
2240	PRINT "PRESS ANY KEY TO CONTINUE OR 'RETURN' FOR GAME:"
2250	E$ = INKEY$: IF E$ = "" THEN 2250
2260	IF E$ = CHR$(13) THEN 2590
2270	PRINT CL1$;
2280	PRINT "       THE  SIDE  SHOT "
2290	PRINT
2300	PRINT "SHOOTING THE MIDDLE STAR ON ONE SIDE CAUSES THAT "
2310	PRINT "SIDE ONLY TO CHANGE TYPE.
2320	PRINT 
2330	PRINT "EXAMPLE: "
2340	PRINT
2350	PRINT " * * *     o * *          * o *     o o *"
2360	PRINT
2370	PRINT " X * *  =  o * *          X * o  =  o * o"
2380	PRINT
2390	PRINT " * * *     o * *          o * *     * * *"
2400	PRINT
2410	PRINT "PRESS ANY KEY TO CONTINUE"
2420	E$ = INKEY$: IF E$ = "" THEN 2420
2430	PRINT CL1$;
2440	PRINT "       THE  CORNER  SHOT"
2450	PRINT
2460	PRINT "SHOOTING AT A CORNER REVERSES ALL "
2470	PRINT "STARS AND HOLES IN IT'S CORNER"
2480	PRINT
2490	PRINT "EXAMPLES:
2500	PRINT
2510	PRINT "* * *      * * *          o o o     o o o "
2520	PRINT
2530	PRINT "* * *   =  o o *          * * o  =  o o o"
2540	PRINT 
2550	PRINT "X * *      o o *          X * o     o o o"
2560	PRINT
2570	PRINT "PRESS ANY KEY TO RETURN TO GAME:"
2580	E$ = INKEY$: IF E$ = "" THEN 2580
2590	PRINT CL1;
2600	NN% = 0
2610	IF NS% = 0 THEN 610
2620	GOTO 660
2630	REM-----------------------------------------
2640	REM SUBROUTINE PRINT STAR
2650	L = 0
2660	PRINT REGU;
2670	PRINT G1;
2680	GOSUB 2870
2690	PRINT CRSR;
2700	PRINT CHR$(14);CHR$(10);CHR$(22);CHR$(8);CHR$(2);
2710	GOSUB 2870
2720	PRINT CRSR;
2730	PRINT CHR$(10);CHR$(22);CHR$(32);CHR$(22);CHR$(8);
2740	GOSUB 2870
2750	PRINT CRSR;
2760	PRINT CHR$(22);CHR$(32);RIGHT$(STR$(JJ),1);CHR$(32);CHR$(22);
2770	GOSUB 2870
2780	PRINT CRSR;
2790	PRINT CHR$(21);CHR$(22);CHR$(32);CHR$(22);CHR$(25);
2800	GOSUB 2870
2810	PRINT CRSR;
2820	PRINT CHR$(2);CHR$(21);CHR$(22);CHR$(25);CHR$(14);
2830	PRINT G0;
2840	PRINT REGU;
2850	RETURN
2860	REM-----------------------------------------
2870	REM COMPUTES CURSOR POSITION
2880	CRSR = CHR$(27)+"="+CHR$(Y(JJ)+L)+CHR$(X(JJ)+32+JJJ): REM POSITIONS CURSOR
2890	L = L + 1
2900	RETURN
2910	REM-----------------------------------------
2920	REM PRINT HOLE
2930	L = 0
2940	PRINT REG;
2950	PRINT G1;
2960	GOSUB 2870
2970	PRINT CRSR;
2980	PRINT CHR$(17);CHR$(32);CHR$(23);CHR$(32);CHR$(5);
2990	GOSUB 2870
3000	PRINT CRSR;
3010	PRINT CHR$(32);CHR$(32);CHR$(32);CHR$(32);CHR$(32);
3020	GOSUB 2870
3030	PRINT CRSR;
3040	PRINT CHR$(1);CHR$(32);RIGHT$(STR$(JJ),1);CHR$(32);CHR$(4);
3050	GOSUB 2870
3060	PRINT CRSR;
3070	PRINT CHR$(32);CHR$(32);CHR$(32);CHR$(32);CHR$(32);
3080	GOSUB 2870
3090	PRINT CRSR;
3100	PRINT CHR$(26);CHR$(32);CHR$(24);CHR$(32);CHR$(3);
3110	PRINT G0;
3120	PRINT REG;
3130	RETURN
2870
3090	PRINT CRSR;
3100	PRINT CHR$(26);CHR$(32);