Skip to content

Instantly share code, notes, and snippets.

@zeroeth
Created March 12, 2020 08:06
Show Gist options
  • Save zeroeth/0912b3d68b587d557d2e2eb2839a4d12 to your computer and use it in GitHub Desktop.
Save zeroeth/0912b3d68b587d557d2e2eb2839a4d12 to your computer and use it in GitHub Desktop.
5 REM FOR TRS-80 MODEL 100 IN 80 COLUMN MODE(ULTIMATEROMII)
10 GOSUB 100
20 INPUT"ENTER ORIGIN";B$
25 PRINT CHR$(7)
30 GOSUB 500
40 OX=IX:OY=IY:OZ=IZ
50 GOSUB 100
60 INPUT"ENTER DESTINATION";B$
65 PRINT CHR$(7)
70 GOSUB 500
80 DX=IX:DY=IY:DZ=IZ
90 GOTO 800
100 PRINT CHR$(12)
110 PRINT"1.Abbadon 8.Colossus 15.Monolith 22.Tara"
120 PRINT"2.Achamandra 9.Cornwall 16.Moonjam 23.Timos"
130 PRINT"3.Avatar 10.Enlas-Dhu 17.Phoenix Nebula 24.Videga"
140 PRINT"4.Azrael 11.Estremerine 18.Rhad 25.Winterjewel"
150 PRINT"5.Beehive 12.Fiobrachne 19.Sheol"
160 PRINT"6.Cenotaph 13.Lungold 20.Shiva"
170 PRINT"7.Chelsea 14.Medusa 21.Sunrise"
180 RETURN
500 REM SYSTEM COORDS
510 IF B$="1" THEN IX=1:IY=-4:IZ=7
520 IF B$="2" THEN IX=-7:IY=-2:IZ=0
530 IF B$="3" THEN IX=-5:IY=-8:IZ=5
540 IF B$="4" THEN IX=-8:IY=11:IZ=-2
550 IF B$="5" THEN IX=-1:IY=12:IZ=-2
560 IF B$="6" THEN IX=16:IY=-1:IZ=-3
570 IF B$="7" THEN IX=-5:IY=-11:IZ=2
580 IF B$="8" THEN IX=-15:IY=-1:IZ=3
590 IF B$="9" THEN IX=-16:IY=-9:IZ=-4
600 IF B$="10" THEN IX=12:IY=1:IZ=1
610 IF B$="11" THEN IX=2:IY=10:IZ=0
620 IF B$="12" THEN IX=1:IY=15:IZ=4
630 IF B$="13" THEN IX=-13:IY=-3:IZ=-3
640 IF B$="14" THEN IX=-12:IY=2:IZ=2
650 IF B$="15" THEN IX=0:IY=0:IZ=0
660 IF B$="16" THEN IX=-1:IY=4:IZ=3
670 IF B$="17" THEN IX=4:IY=-1:IZ=10
680 IF B$="18" THEN IX=-2:IY=-4:IZ=3
690 IF B$="19" THEN IX=-15:IY=12:IZ=-4
700 IF B$="20" THEN IX=0:IY=-13:IZ=-1
710 IF B$="21" THEN IX=-13:IY=5:IZ=0
720 IF B$="22" THEN IX=9:IY=5:IZ=3
730 IF B$="23" THEN IX=4:IY=-6:IZ=-1
740 IF B$="24" THEN IX=1:IY=1:IZ=6
750 IF B$="25" THEN IX=6:IY=3:IZ=5
760 RETURN
800 REM TRAVEL CALC
810 DIST = SQR(ABS(OX-DX)^2 + ABS(OY-DY)^2 + ABS(OZ-DZ)^2 )
815 GOSUB 1000
820 A$ = "##.#"
840 PRINT@30,"DISTANCE:";
850 PRINT USING A$; DIST;
852 PRINT@110,"DAYS:";:PRINT USING A$; DIST;
853 PRINT CHR$(7)
854 PRINT@190,"FUEL USED:";:PRINT USING A$; DIST*2;
855 PRINT@270,"";:INPUT"ANOTHER(Y/N)";B$
870 IF B$="Y" THEN GOTO 10
880 GOTO 10000
1000 REM DISPLAY MAP
1010 PRINT CHR$(12)
1020 LINE(0,0)-(81,0)
1030 LINE(0,63)-(81,63)
1040 LINE(0,0)-(0,63)
1050 LINE(81,0)-(81,63)
1060 PSET(42,24)
1070 PSET(26,28)
1080 PSET(30,16)
1090 PSET(24,54)
1100 PSET(38,56)
1110 PSET(72,30)
1120 PSET(30,10)
1130 PSET(10,30)
1140 PSET(8,14)
1150 PSET(64,34)
1160 PSET(44,52)
1170 PSET(42,62)
1180 PSET(14,26)
1190 PSET(16,36)
1200 PSET(40,32)
1210 PSET(38,40)
1220 PSET(48,30)
1230 PSET(36,24)
1240 PSET(10,56)
1250 PSET(40,6)
1260 PSET(14,42)
1270 PSET(58,42)
1280 PSET(48,20)
1290 PSET(42,34)
1300 PSET(52,38)
1310 P1X=(OX+20)*2:P1Y=(OY+16)*2
1320 P2X=(DX+20)*2:P2Y=(DY+16)*2
1330 LINE(P1X,P1Y)-(P2X,P2Y)
1340 RETURN
10000 CLS
10010 PRINT "END OF LINE"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment