PROG : 16509
D-FILE: 18005
VARS : 18798
E-LINE: 18799
STKBOT: 18799
STKEND: 18799
9999 means line number
PRINT means treat as KEYWORD P
10 REM ***ROOMS****SLR/2025***
20 CLS
30 RAND 0
40 REM **INIT
50 GOSUB 1000
60 REM **BUILD ROOMS
70 GOSUB 2000
80 CLS
90 REM **ROOMS
100 FOR L=1 TO NR
110 PRINT L;":";R(L,1);" ";R(L,
2);" ";R(L,3);" ";R(L,4)
120 NEXT L
130 PAUSE 100
190 CLS
200 REM **PRINT
210 FOR L=1 TO NR
220 LET X=R(L,1)
230 LET Y=R(L,2)
240 LET X1=X+R(L,3)
250 LET Y1=Y+R(L,4)
260 FOR A=X TO X1
270 PLOT A,Y
280 PLOT A,Y1
290 NEXT A
300 FOR B=Y TO Y1
310 PLOT X,B
320 PLOT X1,B
330 NEXT B
340 NEXT L
350 IF NR<NM THEN GOTO 70
400 PAUSE 1000
410 RUN
500 SAVE "ROOMS"
510 RUN
1000 REM **INIT
1010 LET NR=1
1020 LET NM=10
1030 LET RM=5
1040 DIM R(NM,4)
1050 LET R(1,1)=0
1060 LET R(1,2)=0
1070 LET R(1,3)=63
1080 LET R(1,4)=43
1090 RETURN
2000 REM **SPLIT
2010 FOR L=1 TO NR
2020 LET X=R(L,1)
2030 LET Y=R(L,2)
2040 LET W=R(L,3)
2050 LET H=R(L,4)
2060 GOSUB 3000+100*INT (RND*2)
2070 IF NOT (W>=RM AND W1>=RM
AND H>=RM AND H1>=RM) THEN
GOTO 2170
2080 IF NR=10 THEN RETURN
2090 LET R(L,1)=X
2100 LET R(L,2)=Y
2110 LET R(L,3)=W
2120 LET R(L,4)=H
2130 LET NR=NR+1
2140 LET R(NR,1)=X1
2150 LET R(NR,2)=Y1
2160 LET R(NR,3)=W1
2170 LET R(NR,4)=H1
2180 NEXT L
2190 RETURN
3000 REM **SPLIT VERT
3010 LET WN=INT (RND*(W/2)+W/4)
3020 LET X1=X+WN
3030 LET Y1=Y
3040 LET W1=W-WN
3050 LET W=WN-1
3060 LET H1=H
3070 PRINT " SV:";X;" ";Y;" ";W;
" ";H;"..";X1;" ";Y1;" ";W1;" ";
H1
3080 RETURN
3100 REM **SPLIT HORZ
3110 LET X1=X
3120 LET HN=INT (RND*(H/2)+H/4)
3130 LET Y1=Y+HN
3140 LET H1=H-HN
3150 LET H=HN-1
3160 LET W1=W
3170 PRINT " SH:";X;" ";Y;" ";W;
" ";H;"..";X1;" ";Y1;" ";W1;" ";
H1
3180 RETURN