home *** CD-ROM | disk | FTP | other *** search
- 1 '
- 2 ' GRID Demo
- 3 '
- 10 DEFINT a-z:OPTION BASE 1
- 20 DIM x(30),y(10):
- 30 RANDOMIZE -4525:CLS:LOCATE 1,1 : f$ = "┌─┬┐│ ││├─┼┤└─┴┘":m=-1
- 35 for rep = 1 to 150
- 40 xspan = INT(RND(1)*40)+1 : vspan = INT(RND(1)*10)+1
- 50 xpieces = INT(RND(1)*28)+1 : vpieces = INT(RND(1)*8)+1
- 55 span = xspan / xpieces: xxspan = 1
- 60 FOR i = 1 TO xpieces-1
- 70 x(i) = span : xxspan=xxspan + span + 1
- 100 NEXT:xspan = xspan + xpieces + 1
- 110 x(i+1)=-1
- 150 span = vspan / vpieces : yyspan = 1
- 160 FOR i = 1 TO vpieces-1
- 170 y(i) = span : yyspan=yyspan + span + 1
- 200 NEXT:vspan = vspan + vpieces + 1
- 210 y(i+1)=-1
- 220 if m=-1 then mode=0 else mode = INT(RND(1)*6)
- 225 CALL gridspan(x(1),xxspan):CALL gridspan(y(1),yyspan)
- 230 x = INT(RND(1)*79)+1 : IF x > (80 - xxspan) then 230 'x = (80 - xxspan)
- 240 y = INT(RND(1)*24)+1 : IF y > (25 - yyspan) then 240 'y = (25 - yyspan)
- 250 c = RND(1)*127+1:if int(c/16) = c mod 16 then 250
- 300 locate y,x:call grid(x(1),y(1),f$,c,mode)
- 310 next
- 320 if m=-1 then m=0:goto 35