My first attempt at building an Ultima game on the ZX81 using BASIC. Needless to say, it was a bit too slow.
PROG : 16509
D-FILE: 22000
VARS : 22793
E-LINE: 22794
STKBOT: 22794
STKEND: 22794
9999 means line number
PRINT means treat as KEYWORD P
10 REM **ZX-ULTIMA**SLR/2012**
20 REM **
30 REM **SETUP
40 GOSUB 1000
50 REM **MAIN
60 REM **
70 REM ****PRINT SCREEN
80 GOSUB 250
90 REM ****GET INPUT
100 GOSUB 500
110 REM ****MANAGE CHANGE
120 IF MOVE THEN GOSUB 750
130 REM ****RINSE AND REPEAT
140 IF NOTEND THEN GOTO 80
150 REM ****GAME OVER
160 PRINT "GAME OVER"
170 PRINT "PRESS ANY KEY TO RES
TART?"
180 IF INKEY$<>"" THEN RUN
190 GOTO 180
230 REM ****
240 REM **PRINT SCREEN
250 PRINT AT 0,0;(J$ AND Z=0);(
K$ AND Z)
260 LET Z=NOT Z
470 RETURN
480 REM ****
490 REM ****GET INPUT
500 LET MOVE=0
510 IF INKEY$="" THEN RETURN
520 LET MOVE=1
530 LET A=X-(1 AND INKEY$="W")+
(1 AND INKEY$="S")
540 LET B=Y-(1 AND INKEY$="A")+
(1 AND INKEY$="D")
550 LET X=A
560 LET Y=B
720 RETURN
730 REM ****
740 REM ****MANAGE CHANGE
750 LET X1=0
751 FAST
752 FOR L=X-2 TO X+2
755 LET Y1=0
760 FOR M=Y-2 TO Y+2
770 LET LOC=1+(32*(L+(22 AND L<
1)-(22 AND L>22)))+(M+(32 AND M<
1)-(32 AND M>32))
780 LET TILE=VAL W$(LOC)-1
782 LET SLOC=34+32*X1*4+Y1*4
783 REM PRINT AT 0,0;J$;AT 2,22
;"L=";L;AT 3,22;"M=";M;AT 4,22;"
LOC=";LOC;AT 5,22;"SLOC=";SLOC;
AT 6,22;"TILE=";TILE;AT 7,22;"X1
=";X1;AT 8,22;"Y1=";Y1
790 IF L<>X OR M<>Y THEN GOSUB
1500+TILE*100
799 LET Y1=Y1+1
800 NEXT M
805 LET X1=X1+1
810 NEXT L
820 SLOW
970 RETURN
980 REM ****
990 REM **SETUP
1000 LET NOTEND=1
1010 LET X=18
1020 LET Y=28
1030 LET A=X
1040 LET B=Y
1050 LET Z=0
1060 LET HEALTH=100
1070 LET STR=5
1080 LET INT=5
1090 LET CON=5
1100 LET CHR=5
1110 LET SEX=0
1120 LET GOLD=0
1130 LET N$="ILO"
1140 LET WEAPON=0
1150 LET MAGIC=10
1160 LET J$="±
²"
1170 FOR L=1 TO 20
1180 LET J$=J$+" !!!!¸¸¸¸!!!!¸¸¸
¸!!!! "
1190 NEXT L
1200 LET J$=J$+"´
÷"
1210 LET K$=J$
1220 LET J$(298 TO 301)="µ¶· "
1230 LET J$(330 TO 333)="±²±ô"
1240 LET J$(362 TO 365)="µ¶ò "
1250 LET J$(394 TO 397)="òò "
1260 LET K$(298 TO 301)="µ¶µ "
1270 LET K$(330 TO 333)="±²´ñ"
1280 LET K$(362 TO 365)="µ¶ "
1290 LET K$(394 TO 397)="ò ñ "
1300 REM ****WORLD
1310 LET W$="1111111111111111111
11111111111111445522232622555552
41111112211111457522332222255532
24411122621111442223333332225333
22241122227111142223533333533333
32224122221211114225553335533333
13322222223211111425655335553231
11332222233311144423333333553231
11333255333311442222233322222223
13333335336311114222622222235323
11332235533311111222553222355322
31113223553511111125753222255532
23311322355511122122232444425532
23331132235511255212224414442552
22223122253511222113324111442555
22221122222211113233341111142557
44211622222211133333334114444255
44421122222211223332411117164254
44442122622211226322241111444444
44444112222211122244441111114444
44472122121111111441111111114644
44411121111111111111111111111111
1111111111111"
1320 GOSUB 750
1460 RETURN
1470 REM ****
1480 REM **TILES
1490 REM ****WATER
1500 LET J$(SLOC TO SLOC+3)="ó¶³
"
1510 LET J$(SLOC+32 TO SLOC+35)=
"¶³ ó"
1520 LET J$(SLOC+64 TO SLOC+67)=
"³ ó¶"
1530 LET J$(SLOC+96 TO SLOC+99)=
" ó¶³"
1540 LET K$(SLOC TO SLOC+3)="³ ó
¶"
1550 LET K$(SLOC+32 TO SLOC+35)=
" ó¶³"
1560 LET K$(SLOC+64 TO SLOC+67)=
"ó¶³ "
1570 LET K$(SLOC+96 TO SLOC+99)=
"¶³ ó"
1580 RETURN
1590 REM ****GRASS
1600 LET J$(SLOC TO SLOC+3)="··
"
1610 LET J$(SLOC+32 TO SLOC+35)=
" ñôô"
1620 LET J$(SLOC+64 TO SLOC+67)=
"ôôò "
1630 LET J$(SLOC+96 TO SLOC+99)=
"ò "
1640 LET K$(SLOC TO SLOC+3)="··
"
1650 LET K$(SLOC+32 TO SLOC+35)=
" ñôô"
1660 LET K$(SLOC+64 TO SLOC+67)=
"ôôò "
1670 LET K$(SLOC+96 TO SLOC+99)=
"ò "
1680 RETURN
1690 REM ****FOREST
1700 LET J$(SLOC TO SLOC+3)=" ±
"
1710 LET J$(SLOC+32 TO SLOC+35)=
"· õ "
1720 LET J$(SLOC+64 TO SLOC+67)=
"± "
1730 LET J$(SLOC+96 TO SLOC+99)=
" ¹ "
1740 LET K$(SLOC TO SLOC+3)=" ±
"
1750 LET K$(SLOC+32 TO SLOC+35)=
"· õ "
1760 LET K$(SLOC+64 TO SLOC+67)=
"± "
1770 LET K$(SLOC+96 TO SLOC+99)=
" ¹ "
1780 RETURN
1790 REM ****SAND
1800 LET J$(SLOC TO SLOC+3)="úùú
ù"
1810 LET J$(SLOC+32 TO SLOC+35)=
"ùúùú"
1820 LET J$(SLOC+64 TO SLOC+67)=
"úùúù"
1830 LET J$(SLOC+96 TO SLOC+99)=
"ùúùú"
1840 LET K$(SLOC TO SLOC+3)="úùú
ù"
1850 LET K$(SLOC+32 TO SLOC+35)=
"ùúùú"
1860 LET K$(SLOC+64 TO SLOC+67)=
"úùúù"
1870 LET K$(SLOC+96 TO SLOC+99)=
"ùúùú"
1880 RETURN
1890 REM ****MOUNTAIN
1900 LET J$(SLOC TO SLOC+3)=" öô
ô"
1910 LET J$(SLOC+32 TO SLOC+35)=
"ö öò"
1920 LET J$(SLOC+64 TO SLOC+67)=
" ö ô"
1930 LET J$(SLOC+96 TO SLOC+99)=
"öòöò"
1940 LET K$(SLOC TO SLOC+3)=" öô
ô"
1950 LET K$(SLOC+32 TO SLOC+35)=
"ö öò"
1960 LET K$(SLOC+64 TO SLOC+67)=
" ö ô"
1970 LET K$(SLOC+96 TO SLOC+99)=
"öòöò"
1980 RETURN
1990 REM ****CITY
2000 LET J$(SLOC TO SLOC+3)=" µù
"
2010 LET J$(SLOC+32 TO SLOC+35)=
"µ±²õ"
2020 LET J$(SLOC+64 TO SLOC+67)=
"µ::õ"
2030 LET J$(SLOC+96 TO SLOC+99)=
"òñòñ"
2040 LET K$(SLOC TO SLOC+3)=" µú
"
2050 LET K$(SLOC+32 TO SLOC+35)=
"µ±²õ"
2060 LET K$(SLOC+64 TO SLOC+67)=
"µ::õ"
2070 LET K$(SLOC+96 TO SLOC+99)=
"òñòñ"
2080 RETURN
2090 REM ****DUNGEON
2100 LET J$(SLOC TO SLOC+3)="·
ô"
2110 LET J$(SLOC+32 TO SLOC+35)=
" ùú "
2120 LET J$(SLOC+64 TO SLOC+67)=
" ùú "
2130 LET J$(SLOC+96 TO SLOC+99)=
" ùú "
2140 LET K$(SLOC TO SLOC+3)="·
ô"
2150 LET K$(SLOC+32 TO SLOC+35)=
" ùú "
2160 LET J$(SLOC+64 TO SLOC+67)=
" ùú "
2170 LET K$(SLOC+96 TO SLOC+99)=
" ùú "
2180 RETURN
2500 LET J$(SLOC TO SLOC+3)="
"
2510 LET J$(SLOC+32 TO SLOC+35)=
" "
2520 LET J$(SLOC+64 TO SLOC+67)=
" "
2530 LET J$(SLOC+96 TO SLOC+99)=
" "
2540 LET K$(SLOC TO SLOC+3)="
"
2550 LET K$(SLOC+32 TO SLOC+35)=
" "
2560 LET K$(SLOC+64 TO SLOC+67)=
" "
2570 LET K$(SLOC+96 TO SLOC+99)=
" "
2990 RETURN
3000 REM **SAVE AND RUN
3010 SAVE "ZU"
3020 RUN