OK. Found it. It's very ugly code, though...

// --------------------------------- //

// Project:

// Start: Saturday, April 02, 2005

// IDE Version: 2.50322

GLOBAL screenx, screeny

GETSCREENSIZE screenx, screeny

maxx=32

maxy=16

redo:

DIM maze[maxx+1][maxy+1]

DIM sol[0]

// Make a grid:

// ###########

// # # # # # #

// ###########

// # # # # # #

// ###########

FOR x=1 TO maxx-1 STEP 2

FOR y=1 TO maxy-1 STEP 2

maze[x][y]=1

NEXT

NEXT

// Now open some paths from the already open places right or down

kills = 0

WHILE FINDPATH(maze[], sol[], .1, 1,1, maxx-1, maxy-1) = FALSE

x=0; y=0; dx=1; dy=0

WHILE maze[x][y]=0 OR maze[x+dx][y+dy]<>0

x=INTEGER(xrand(maxx-2)/ 2)*2+1

y=INTEGER( RND(maxy-2)/ 2)*2+1

dx = RND(1)

dy = 1-dx

IF x=maxx-1; dy=1; dx=0; ENDIF

IF y=maxy-1; IF x=maxx-1; dx=0; dy=0; ELSE; dy=0; dx=1; ENDIF; ENDIF

WEND

maze[x+dx][y+dy] = 1

kills = kills +1

GOSUB ShowIt // - show what it's doing

SHOWSCREEN

IF kills/(maxx*maxy) > 0.28 THEN GOTO redo // too high kill-ratio -> too easy level

WEND

FILLRECT 0,0, screenx,screeny, RGB(0,0,255)

GOSUB ShowIt

SHOWSCREEN

MOUSEWAIT

GOTO redo

// Return a random number [0; maxval], but add more weight on 0 or maxval

FUNCTION xrand: maxval

LOCAL cfac, phi, val1, val2

cfac = .7 // 0 = random, 1 = random, but more weight at head+tail

phi = 360 * RND(10000)/10000

val1 = (1+COS(phi)) / 2 // cosinus part - more weight at head+taile

val2 = ABS(1-phi/180) // linear part - even weighted

// interpolate between both types

RETURN INTEGER(0.1 + maxval * (cfac*val1 + (1-cfac)*val2))

ENDFUNCTION

// Display the playfield

SUB ShowIt:

LOCAL x,y,dx,dy

dx = screenx/(maxx+2)

dy=screeny/(maxy+2)

FOR x=0 TO maxx

FOR y=0 TO maxy

IF (x=1 AND y=1) OR (x=maxx-1 AND y=maxy-1) THEN FILLRECT x*dx, y*dy, (x+1)*dx, (y+1)*dy, RGB(0xff,0,0)

IF maze[x][y]=0 THEN FILLRECT x*dx, y*dy, (x+1)*dx, (y+1)*dy, RGB(0xff,0xff,0xff)

NEXT

NEXT

ENDSUB