--- title: "Tycoon" id: 63138 type: "computer_media" slug: "tycoon" url: "http://localhost/computer_media/tycoon/" markdown_url: "http://localhost/computer_media/tycoon.md" published_at: "2026-01-26T12:46:10+00:00" modified_at: "2026-03-30T21:46:07+00:00" author: "David Anderson" featured_image: url: "http://localhost/wp-content/uploads/2026/01/tycoon-2.png" excerpt: "A ten-level oil-drilling game that switches UDG sets via direct POKEs, detects its host machine at runtime, and lets mines blow up your pipes underground." category: - name: "Archived Media" slug: "archived-media" taxonomy: "category" url: "http://localhost/category/archived-media/" post_tag: - name: "Byte Power" slug: "byte-power" taxonomy: "post_tag" url: "http://localhost/tag/byte-power/" - name: "Downloadable" slug: "downloadable" taxonomy: "post_tag" url: "http://localhost/tag/downloadable/" - name: "TS 2068" slug: "ts2068" taxonomy: "post_tag" url: "http://localhost/tag/ts2068/" model: - name: "Timex/Sinclair 2068" slug: "ts-2068" taxonomy: "model" url: "http://localhost/model/ts-2068/" indiv: - name: "Kristian Boisvert" slug: "boisvert-kristian" taxonomy: "indiv" url: "http://localhost/indiv/boisvert-kristian/" genre: - name: "Game" slug: "game" taxonomy: "genre" url: "http://localhost/type/game/" media_contents: - id: 63049 title: "Byte Power Spring 1987" type: "computer_media" url: "http://localhost/computer_media/byte-power-spring-1987/" media_type: "Program" programmers: - name: "Kristian Boisvert" slug: "boisvert-kristian" taxonomy: "indiv" url: "http://localhost/indiv/boisvert-kristian/" mediadate: "1987" producer_company: - id: 25181 title: "Byte Power" type: "company" url: "http://localhost/company/byte-power/" images: - url: "http://localhost/wp-content/uploads/2026/01/tycoon-2.png" - url: "http://localhost/wp-content/uploads/2026/01/tycoon-1.png" article_media: - id: 63075 title: "Tycoon" type: "article" url: "http://localhost/article/tycoon/" media_type_tags: "Game" --- Tycoon! is an oil-drilling game in which the player manoeuvres a pump across the top of a grid, extends pipes downward to reach oil wells, and pumps as much oil as possible before a countdown timer expires. Across up to ten levels the underground hazards — mines (costing 3 pipes) and rocks (costing 1 pipe) — increase in number, and oil wells vary in size (small, medium, large) affecting their capacity and graphical representation. The program uses POKEs to the UDG base-address system variable (23675/23676) to switch between four separate UDG sets stored as machine-code blocks at addresses from 60000 upward, loaded from tape at line 9010. Platform detection at line 1090 distinguishes between the TS2068 (using the STICK keyword for joystick input) and the Spectrum (reading the Kempston port directly via IN 31), and the timer is driven by the Spectrum’s FRAMES counter at address 23672. *** ## Program Structure The code divides neatly into a loader/saver stub, a menu/rules section, the main game loop, and a library of subroutines: 1. **Lines 9000–9999:** Tape loader (line 9000) and saver (line 9999). The loader displays a splash screen, loads a 400-byte machine-code block to address `6E4` (60004 decimal, effectively 60000), then falls through to `RUN`. 2. **Lines 1000–1380:** Title screen menu and rules pages. 3. **Lines 1390–1470:** Game initialisation — dimensions the oil-well array, seeds level parameters, calls background, oil, and obstacle setup routines. 4. **Lines 1470–2560:** Main game loop: input handling, digging, mine/rock collision, bomb firing, oil pumping, and game-over logic. 5. **Lines 2570–3170:** Subroutine library — obstacle placement, timer, background draw, oil-well setup, UDG switching, attribute checking, and the centred-text box printer. ## Platform Detection Line 1090 reads `PEEK 153`; on a TS2068 this location holds the value 82 (part of the TS2068 ROM signature). If the value differs, `SPECTRUM` is set to 1 and all joystick reads use `IN 31` (Kempston interface) instead of the TS2068 `STICK` keyword. Lines 1600–1622 manually decode the Kempston byte and remap it to the same 1/2/4/8 directional encoding used by `STICK`. ## UDG Switching via System Variable POKEs The most technically distinctive feature is the dynamic UDG set. Four distinct 8-sprite blocks are stored consecutively in the machine-code area beginning at address 60000. Subroutine 2930 writes a chosen base address into the UDG pointer at addresses 23675 (low byte) and 23676 (high byte), effectively remapping all UDG characters `\a`–`\i` to a new set of bitmaps instantly. The four sets and their base addresses are: | Purpose | Address (AD) | | --- | --- | | Pump / pipe sprites (game object) | 60000 (`6E4` in BASIC float notation) | | Large oil well variant 1 | 60144 | | Large oil well variant 2 | 60216 | | Medium oil well | 60288 | | Small oil well | 60360 | Each set is 72 bytes (9 UDGs × 8 bytes). The address arithmetic in line 2930 uses `POKE 23675, AD-256*INT(AD/256)` and `POKE 23676, INT(AD/256)` as a pure-BASIC way to split a 16-bit value into low and high bytes without `INT` overflow issues. ## Oil Well Data Structure Oil wells are tracked in a 15×5 array `O`. Each row encodes one well: | Column | Meaning | | --- | --- | | `O(F,1)` | Screen row of top-left corner | | `O(F,2)` | Screen column of top-left corner | | `O(F,3)` | Current ink colour index (changes as oil depletes) | | `O(F,4)` | Remaining oil units (decrements on each pump cycle) | | `O(F,5)` | Well size type (1–4), selects UDG set and subroutine offset | The well’s initial oil capacity is `(5 - size) * 20`, so smaller wells hold more oil. Ink colour steps up every 20 units pumped (line 2320), giving a visual depletion indicator. When `O(F,4)` reaches zero the well is erased and `EMPTY` incremented; when `EMPTY = LEVEL` the level ends. ## Timer Implementation The subroutine at line 2620 polls the Spectrum FRAMES low byte at address 23672. When it exceeds 60 (approximately one second at 50 Hz), `TIME` is decremented and the counter reset to 0. This is called from within the main loop rather than via interrupts, so timing accuracy depends on how many iterations the loop completes per second. When `TIME` reaches zero, `EMPTY` is forced equal to `LEVEL`, triggering the end-of-level or game-over path. ## Obstacle and Collision Detection Rather than maintaining a separate map array, the game uses `ATTR` to read colour attributes directly from the display file for collision detection. Attribute values used as sentinels are: - `36` — clear ground (PAPER 4, INK 4) - `37` — mine - `38` — rock - `<36` — oil well cell (any bright or different ink/paper) Line 1780 checks `ATTR(DEEP+4, PL+1) < 36` to detect hitting an oil well; line 1810 checks for value 38 (rock); line 1830 checks for 37 (mine). This approach avoids a separate map array at the cost of fragility if screen colours are inadvertently altered. ## Bomb Firing Animation Lines 2040–2210 animate a bomb travelling down the pipe column. A `FOR G=0 TO DEEP` loop prints a bomb UDG at each row with `BEEP .01, G*2` for a rising-pitch sound effect. At the target cell, if the attribute indicates a mine or rock the appropriate explosion UDGs (`\q` and `\r`) are flashed in INK 2 (red). Firing a bomb into an oil well (attribute `< 36` at depth) triggers the extended destruction sequence at line 2340, which explodes the well, the pipes, and the pump in sequence before ending the game. ## Centred Text Box Subroutine The subroutine at lines 3030–3170 provides a reusable animated reveal effect. Given string `A$`, row `X`, and ink colour `Y`, it first calls line 3110 to draw a double-border rectangle using `PLOT`/`DRAW` in pixel coordinates derived from the string length and row. It then progressively prints the string expanding outward from its centre character using the idiom `A$(LEN A$/2 - F TO LEN A$/2 + F)`, with a `BEEP .008, F` rising tone. All title strings are therefore padded to even lengths to ensure correct centering. ## Source Code ``` 1000 REM 1010 REM TYCOON! 1020 REM RESET 1987 BYTE POWER 1030 REM WRITTEN BY K. BOISVERT 1040 REM 1050 1060 INK 0: PAPER 7: BORDER 7: CLEAR 59999 1070 POKE 23658,8: REM CAPS LOCK 1080 REM CHECK IF ON SPECTRUM 1090 LET SPECTRUM=0: IF PEEK 153<>82 THEN LET SPECTRUM=1 1100 REM MENU 1110 LET A$="TYCOON! ": LET X=2: LET Y=2: GO SUB 3030 1120 LET A$="P TO PLAY ": LET X=6: LET Y=1: GO SUB 3030 1130 LET A$="Q TO QUIT ": LET X=9: LET Y=1: GO SUB 3030 1140 LET A$="R FOR RULES ": LET X=12: LET Y=1: GO SUB 3030 1150 LET A$="WRITTEN BY K BOISVERT ": LET X=16: LET Y=5: GO SUB 3030 1160 LET A$="COPYRIGHT 1987 BYTE POWER ": LET X=19: LET Y=4: GO SUB 3030 1170 PAUSE 0: LET A$=INKEY$ 1180 IF A$="Q" THEN STOP 1190 IF A$="R" THEN GO TO 1220 1200 IF A$="P" THEN GO TO 1390 1210 GO TO 1170 1220 REM RULES 1230 CLS : LET A$="TYCOON! ": LET X=2: LET Y=2: GO SUB 3030 1240 PRINT AT 5,0;"In this game, you are digging for oil..."''"you are supplied with a pump and30 pipes. You must pump as much oil as you can in a given time, but be careful...there are rocksand mines in the ground and theyuse up your pipes." 1250 PRINT '"Once the time is up, you will goto the next level...which will be a little more dangerous." 1260 PRINT '"At the end of 10 levels the gameends.";#1;AT 1,0;"Press any key to continue...": PAUSE 0: CLS 1270 LET A$="TYCOON! ": LET X=2: LET Y=2: GO SUB 3030 1280 PRINT AT 5,0;"Be careful not to hit one of these:"''"\n: MINE will cost you 3 pipes"''"\o: MINE will cost you 3 pipes"''"\p: ROCK will cost you 1 pipe" 1290 PRINT '"If you hit a rock, you won't be able to destroy it by only digging through it. But if you hit a mine it will go off by itself..." 1300 PRINT #1;AT 1,0;"Press any key to continue...": PAUSE 0: CLS : LET A$="TYCOON! ": LET X=2: LET Y=2: GO SUB 3030 1310 PRINT AT 5,0;"You can destroy these obstacles by firing a bomb down your pipes"''"That would cost you 3 pipes for the mines and 1 pipe for the rocks also..." 1320 PRINT '"BE CAREFUL NOT TO FIRE A BOMB IN AN OIL WELL OR THE GAME WILL BE OVER!" 1330 PRINT '"If you do not pump any oil in a level the game will end when thetime is up..." 1340 PRINT #1;AT 1,0;"Press any key to continue...": PAUSE 0: CLS : LET A$="TYCOON! ": LET X=2: LET Y=2: GO SUB 3030 1350 PRINT AT 5,0;"The keys in this game are:"''"Q- move pipes up"'"A- dig down"'"O- move pump left"'"P- move pump right"''"You cannot move the pump if you are digging, all your pipes mustbe out of the ground to do so..." 1360 PRINT '"You can also use the joystick (Kempston for Spectrum) to move around..." 1370 PRINT #1;AT 1,0;"Press any key to continue...": PAUSE 0: RUN 1380 STOP 1390 REM SET UP GAME 1400 LET OIL=0: DIM O(15,5) 1410 LET SCORE=0: LET LEVEL=5 1420 LET ST=0: LET PIPE=30 1430 LET OIL1=0: LET TIME=90+(LEVEL-4)*30: LET EMPTY=0: GO SUB 2680: GO SUB 2710: GO SUB 2570 1440 PRINT #1;AT 1,0; INK 7; PAPER 1;TAB 31;" " 1450 PRINT #1;AT 1,0; INK 9; PAPER 8;"MONEY:";SCORE;AT 1,14;"PIPES:";PIPE;AT 1,24;"LEVEL:";("0" AND LEVEL<14);LEVEL-4 1460 REM GAME BEGINS... 1470 POKE 23672,0: LET DEEP=0: LET PL=15 1480 GO SUB 2620: LET AD=6E4: GO SUB 2930: IF PIPE=0 AND DEEP=0 THEN GO TO 2540 1490 IF ST=4 THEN PRINT AT 2,PL+3;" ";AT 3,PL+3;" ";AT 4,PL+3;" " 1500 IF ST=8 THEN PRINT AT 2,PL-1;" ";AT 3,PL-1;" ";AT 4,PL-1;" " 1510 IF EMPTY<>LEVEL THEN GO TO 1550 1520 LET LEVEL=LEVEL+1: IF LEVEL=15 THEN GO TO 2540 1530 IF OIL1=0 THEN GO TO 2540 1540 FOR F=DEEP TO 1 STEP -1: PRINT AT F+4,PL+1; PAPER 8; INK 8;" ": LET DEEP=DEEP-1: LET PIPE=PIPE+1: PRINT #1;AT 1,20; INK 7; PAPER 1;PIPE;" ": PAUSE 5: NEXT F: PAUSE 60: GO TO 1430 1550 PRINT AT 2,PL;"\a\b\c";AT 3,PL;"\d\e\f";AT 4,PL;"\g\h\i" 1560 REM MOVE TO RIGHT, LEFT OR DIG DOWN OR MOVE PIPE UP 1570 REM CHECK STICK ON 2068 1580 IF SPECTRUM=0 THEN LET ST=STICK(1,1): LET BT=STICK(2,1): GO TO 1640 1590 REM CHECK STICK ON SPECTRUM 1600 LET ST2=IN 31: IF ST2>31 THEN LET ST2=0 1610 IF ST2>16 THEN LET BT=1: LET ST2=ST2-16 1620 LET ST=(2 AND ST2=4)+(1 AND ST2=8)+(8 AND ST2=1)+(4 AND ST2=2) 1630 REM CHECK KEYS 1640 LET A$=INKEY$ 1650 LET ST1=(1 AND A$="Q")+(2 AND A$="A")+(4 AND A$="O")+(8 AND A$="P") 1660 IF ST1<>0 THEN LET ST=ST1 1670 IF A$=" " THEN LET BT=1 1680 IF DEEP<>0 AND ST>2 THEN LET ST=0 1690 IF ST=4 AND PL>0 THEN LET PL=PL-1 1700 IF ST=8 AND PL<29 THEN LET PL=PL+1 1710 IF ST=2 AND PIPE<>0 AND DEEP<16 THEN GO TO 1750 1720 IF ST=1 AND DEEP<>0 THEN GO TO 1990 1730 IF BT=1 AND DEEP<>0 THEN GO TO 2040 1740 GO TO 1480 1750 REM DIG DOWN 1760 REM CHECK IF ANYTHING UNDER 1770 LET PIPE=PIPE-1: LET DEEP=DEEP+1 1780 IF ATTR (DEEP+4,PL+1)<36 THEN LET DEEP=DEEP-1: LET PIPE=PIPE+1: GO TO 2220 1790 LET OIL=0: PRINT #1;AT 1,20; INK 7; PAPER 1;PIPE;" " 1800 REM CHECK IF IT IS A ROCK IF SO THEN YOU LOSE 1 PIPE 1810 IF ATTR (DEEP+4,PL+1)=38 THEN LET DEEP=DEEP-1: BEEP .01,-20: GO TO 1480 1820 REM CHECK IF IT IS A MINE 1830 IF ATTR (DEEP+4,PL+1)=37 THEN GO TO 1870 1840 REM IF THERE IS NOTHING DIG DOWN 1850 PRINT AT DEEP+4,PL+1; INK 0; PAPER 8; OVER 1;"\j" 1860 GO TO 1480 1870 REM EXPLOSION WHEN YOU HIT A MINE 1880 INK 2: PAPER 8: PRINT AT DEEP+4,PL+1;"\q": BEEP .002,10 1890 PRINT AT DEEP+3,PL+1;"\q": BEEP .002,20 1900 PRINT AT DEEP+2,PL+1;"\q": BEEP .002,0: PAUSE 5 1910 PRINT AT DEEP+4,PL+1;"\r": BEEP .002,-10 1920 GO SUB 2620 1930 PRINT AT DEEP+3,PL+1;"\r": BEEP .002,-5 1940 PRINT AT DEEP+2,PL+1;"\r": BEEP .002,-20: PAUSE 5 1950 FOR G=DEEP+4 TO DEEP+2 STEP -1: PRINT AT G,PL+1;" ": NEXT G: PAUSE 5 1960 REM YOU LOSE 3 PIPES WHEN YOU HIT A MINE 1970 LET DEEP=DEEP-3: IF DEEP<0 THEN LET DEEP=0 1980 INK 8: GO TO 1480 1990 REM MOVE PIPES UP 2000 LET OIL=0: LET PIPE=PIPE+1: LET DEEP=DEEP-1: IF DEEP<0 THEN LET DEEP=0: LET PIPE=PIPE-1 2010 PRINT #1;AT 1,20; INK 7; PAPER 1;PIPE;" " 2020 PRINT AT DEEP+5,PL+1; INK 4; PAPER 4; OVER 1;"\j" 2030 GO TO 1480 2040 FOR G=0 TO DEEP 2050 IF ATTR (G+5,PL+1)=37 AND G=DEEP THEN LET DEEP=DEEP+1: GO TO 1870 2060 IF ATTR (G+5,PL+1)<36 AND G=DEEP THEN GO TO 2340 2070 GO SUB 2620 2080 PRINT AT G+5,PL+1;"\m";AT G+4,PL+1;("\j" AND G<>0) 2090 BEEP .01,G*2 2100 NEXT G 2110 REM EXPLOSION OF BOMB 2120 INK 2: PRINT AT G+4,PL+1;"\q": BEEP .002,10 2130 PRINT AT G+3,PL+1;"\q": BEEP .002,20: PAUSE 8 2140 GO SUB 2620 2150 PRINT AT G+4,PL+1;"\r": BEEP .002,0 2160 PRINT AT G+3,PL+1;"\r": BEEP .002,-10: PAUSE 8 2170 INK 8: PRINT AT G+4,PL+1;" " 2180 PRINT AT G+3,PL+1;" ": PAUSE 5 2190 REM YOU LOSE 1 PIPE WHEN THE EXPLOSION OCCURS 2200 LET DEEP=DEEP-1: IF DEEP<0 THEN LET DEEP=0 2210 GO TO 1480 2220 REM PUMP OIL 2230 LET OIL1=1: IF OIL<>0 THEN LET F=OIL: GO TO 2260 2240 GO SUB 2980 2250 REM FIRE ON TOP OF PUMP 2260 FOR F=CODE "\k" TO CODE "\l": PRINT AT 2,PL+1; OVER 1; INK 8; PAPER 8;(CHR$ (F-1) AND F=155);AT 2,PL+1;CHR$ F: BEEP .002,(F-153)*10: PAUSE 3: NEXT F 2270 REM OIL LEFT IN WELL 2280 LET O(OIL,4)=O(OIL,4)-1: LET SCORE=SCORE+10: PRINT #1; INK 8; PAPER 8;AT 1,6;SCORE 2290 REM IF WELL EMPTY, ERASE IT 2300 IF O(OIL,4)=0 THEN LET EMPTY=EMPTY+1: LET F=OIL: OVER 1: INK 4: PAPER 4: GO SUB 2730+40*O(OIL,5): OVER 0: INK 8: PAPER 8: GO TO 1480 2310 REM CHANGE COLOR OF WELL 2320 IF O(OIL,4)/20=INT (O(OIL,4)/20) THEN LET O(OIL,3)=O(OIL,3)+1: LET F=OIL: INK O(F,3)-1: PAPER 8: GO SUB 2720+20*O(OIL,5): INK 8 2330 GO TO 1480 2340 REM YOU FIRED A BOMB IN AN OIL WELL!!!!!!!!!!!!!!! 2350 PRINT AT G+4,PL+1; INK 8; PAPER 8;"\j": GO SUB 2980 2360 IF O(OIL,5)=1 OR O(OIL,5)=2 THEN LET X=3: LET Y=3 2370 IF O(OIL,5)=3 THEN LET X=3: LET Y=2 2380 IF O(OIL,5)=4 THEN LET X=2: LET Y=2 2390 REM WELL EXPLODES 2400 FOR H=CODE "\q" TO CODE "\r": LET A$=CHR$ H+CHR$ H+CHR$ H: FOR F=0 TO X-1: PRINT AT O(OIL,1)+F,O(OIL,2);A$( TO Y): BEEP .002,INT (RND*40)-20: NEXT F: NEXT H 2410 FOR H=CODE "\r" TO CODE "\q" STEP -1: LET A$=CHR$ H+CHR$ H+CHR$ H: FOR F=0 TO X-1: PRINT AT O(OIL,1)+F,O(OIL,2);A$( TO Y): BEEP .002,INT (RND*40)-20: NEXT F: NEXT H 2420 FOR F=0 TO X-1: PRINT AT O(OIL,1)+F,O(OIL,2); INK 4; PAPER 4;" "( TO Y): NEXT F 2430 GO SUB 2620 2440 REM YOUR PIPES EXPLODE 2450 INK 2: PAPER 8: FOR F=DEEP TO 1 STEP -1: FOR G=CODE "\q" TO CODE "\r": PRINT AT F+4,PL+1;CHR$ G: BEEP .002,INT (RND*41)-20: NEXT G 2460 PRINT AT F+4,PL+1;" ": NEXT F 2470 GO SUB 2620 2480 REM YOUR PUMP EXPLODES 2490 FOR H=CODE "\q" TO CODE "\r": LET A$=CHR$ H+CHR$ H+CHR$ H: FOR F=2 TO 4: PRINT AT F,PL;A$: BEEP .002,INT (RND*40)-20: NEXT F: NEXT H 2500 GO SUB 2620 2510 FOR H=CODE "\r" TO CODE "\q" STEP -1: LET A$=CHR$ H+CHR$ H+CHR$ H: FOR F=2 TO 4: PRINT AT F,PL;A$: BEEP .002,INT (RND*40)-20: NEXT F: NEXT H 2520 FOR F=2 TO 4: PRINT AT F,PL; INK 4; PAPER 5;" ": NEXT F 2530 REM GAME OVER 2540 LET A$="G A M E O V E R" 2550 FOR F=1 TO 32: PRINT AT 11,32-F; INK 7; PAPER 1;A$( TO F) 2560 NEXT F: PAUSE 600: RUN 2570 REM SET UP BOMBS + ROCKS 2580 FOR F=1 TO 20+((LEVEL-5)*5) 2590 LET X1=7+INT (RND*14): LET Y1=1+INT (RND*30): IF ATTR (X1,Y1)<>36 THEN GO TO 2590 2600 LET AD=60072: GO SUB 2930: LET X=INT (RND*3): PRINT AT X1,Y1;("\e" AND X=0);("\f" AND X=1);("\g" AND X=2) 2610 NEXT F: RETURN 2620 REM TIMER 2630 IF PEEK 23672<60 THEN RETURN 2640 LET TIME=TIME-1: POKE 23672,0: IF TIME<0 THEN LET TIME=0 2650 PRINT AT 0,12; INK 7; PAPER 1;"TIME:";("0" AND TIME<100);("0" AND TIME<10);TIME; 2660 IF TIME=0 THEN LET EMPTY=LEVEL 2670 RETURN 2680 REM SET UP BACKGROUNG 2690 INK 0: PAPER 5: BORDER 4: CLS : FOR F=5 TO 21: PRINT AT F,0; PAPER 4; INK 4;TAB 31;" ": NEXT F 2700 PRINT AT 0,0; INK 7; PAPER 1;TAB 31;" ": PAPER 8: RETURN 2710 REM SET UP OIL 2720 FOR F=1 TO LEVEL 2730 LET O(F,1)=8+INT (RND*12): LET O(F,2)=1+INT (RND*28): GO SUB 2950 2740 IF A<>324 THEN GO TO 2730 2750 LET O(F,3)=INT (RND*4)+1: LET O(F,4)=(5-O(F,3))*20: LET O(F,5)=O(F,3) 2760 INK O(F,5)-1: GO SUB 2730+40*O(F,5): NEXT F: INK 0: RETURN 2770 REM BIG OIL WELL 2780 LET AD=60144: GO SUB 2930 2790 PRINT AT O(F,1),O(F,2);"\a\b\c";AT O(F,1)+1,O(F,2);"\d\e\f";AT O(F,1)+2,O(F,2);"\g\h\i" 2800 RETURN 2810 REM BIG OIL WELL #2 2820 LET AD=60216: GO SUB 2930 2830 PRINT AT O(F,1),O(F,2);"\a\b\c";AT O(F,1)+1,O(F,2);"\d\e\f";AT O(F,1)+2,O(F,2);"\g\h\i" 2840 RETURN 2850 REM MEDIUM OIL WELL 2860 LET AD=60288: GO SUB 2930 2870 PRINT AT O(F,1),O(F,2);"\a\b";AT O(F,1)+1,O(F,2);"\d\e";AT O(F,1)+2,O(F,2);"\g\h" 2880 RETURN 2890 REM SMALL OIL WELL 2900 LET AD=60360: GO SUB 2930 2910 PRINT AT O(F,1),O(F,2);"\a\b";AT O(F,1)+1,O(F,2);"\d\e" 2920 RETURN 2930 REM POKE UDG'S AT VAR 'AD' 2940 POKE 23675,AD-256*INT (AD/256): POKE 23676,INT (AD/256): RETURN 2950 REM CHECK IF OIL UNDER 2960 LET A=0: FOR G=O(F,1) TO O(F,1)+2: FOR H=O(F,2) TO O(F,2)+2: LET A=A+ATTR (G,H): NEXT H: NEXT G 2970 RETURN 2980 REM CHECK WHICH OIL WELL 2990 FOR F=1 TO LEVEL 3000 IF O(F,4)=0 THEN GO TO 3020 3010 IF O(F,1)=DEEP+5 AND (O(F,2)=PL+1 OR O(F,2)=PL OR O(F,2)+1=PL) THEN LET OIL=F: RETURN 3020 NEXT F 3030 REM PRINT A$ FROM MIDDLE 3040 REM X IS PRINT POS 0 TO 21 3050 REM Y IS THE INK COLOR 3060 GO SUB 3110 3070 FOR F=0 TO LEN A$/2-1 3080 PRINT AT X,15-F; INK Y;A$(LEN A$/2-F TO LEN A$/2+F) 3090 BEEP .008,F: NEXT F 3100 RETURN 3110 REM DRAW BOX 3120 INK Y: LET X1=175-(X*8)-8: LET Y1=LEN A$*8+8 3130 PLOT (15-(LEN A$/2-1))*8-4,X1-4 3140 DRAW Y1-8,0: DRAW 0,16: DRAW -Y1+8,0: DRAW 0,-16 3150 PLOT (15-(LEN A$/2-1))*8-8,X1-8 3160 DRAW Y1,0: DRAW 0,24: DRAW -Y1,0: DRAW 0,-24 3170 INK 0: RETURN 9000 INK 0: PAPER 7: BORDER 7: CLS : LET A$="TYCOON! ": LET X=5: LET Y=2: GO SUB 3030 9005 PRINT AT 16,2;"WRITTEN BY KRISTIAN BOISVERT": PRINT AT 20,3;"COPYRIGHT 1987 BYTE POWER";AT 21,6;"ALL RIGHTS RESERVED" 9006 PRINT AT 10,0;"STILL LOADING..." 9010 INK 7: LOAD "TYCOON"CODE 6E4: INK 0: RUN 9999 SAVE "TYCOON" LINE 9000: SAVE "TYCOON"CODE 6E4,400: VERIFY "": VERIFY ""CODE : STOP ```