This method doesn't guarantee that all areas are reachable. You get a
lot of cul-de-sacs, which could be good or bad depending on your
game...
[fixed width font]
#####################################################################
#####################################################################
################### ####### ######### ####### ########## # ##########
################### ### ### ######## ####### ### ###### # ##########
######## ######### ### ## ### ### ##### ### ###### # ### ######
######## ## ## # ## ## # # ######
######## ## # ### # ## ## ### ## # #
##### ## # # # # #####
#### #### # # # # ### ## ## # # #####
###### # # # ## # # ## # # #####
#### ## # ## # # # # #### # # # #####
##### # ### # # ### ## # ## ##### #######
##### ###### # # # # ## # ## ### ######
##### ## #### # ##### ###### # #####
##### # ############ ##### # ## # # ########### ########### #####
##### ############## ########### # ########################## ######
###### ########################## ############################ ######
#####################################################################
#####################################################################
#####################################################################
####### #################### ################################ #######
####### ################ ### ### ############### ########### #######
####### ############# ## ### ### ## #### # ##### #### ###### #######
####### ######## ### ## ### ### ## ### ### # #### ## ### #######
### ####### # # ###
##### # ### # ## ## # # # ## #####
### # # ## # # ## ####
## # #### # # ## # # ## ## # # ####
## # #### # ## # ## ## # # # # ########
###### # # ## # ### # # # ########
####### #### ## # ## #####
########### #### # ##### ### ###
##### ## ##### ### ## #### # #####
######## ## ## ###### # ### ## ####### # ### #### # # #####
######## ##### # ###### # #### ## ####### # ###### ##### #########
######## ####### ################## ####### # ############ #########
########################################### #########################
#####################################################################
#####################################################################
#####################################################################
######################### ##### ####################################
######################## ##### ############# #####################
####### ############### ##### ######### ### # ###################
##### ### ###### ## # # # ## ## ### # ### ###############
##### # # # ### # # ## ## ######
##### # # ## ## ### # ####### ######
##### # ### ## ### # ###### ####
##### ### ## #### # # ## ## ### #####
####### # # ## # ## ## ## # # ## # #####
#### ## ## # # ##
###### # ### ### ## ## ####
###### # ##### ### #### # ###
###### ##### ##### #### ### ### # ### ###### ### ###### # ######
###### ##### ##### #### ### ### ## #### ###### ########## # ######
###### ########### ############ ############## ########### ## #######
################## ############ ############## ########### ## #######
#####################################################################
RANDOMIZE TIMER
DIM a(70, 20)
begin:
CLEAR
CLS
FOR l = 1 TO 150
x = INT(RND * 59) + 6
y = INT(RND * 9) + 6
d = INT(RND * 4)
a(x, y) = 1
SELECT CASE d
CASE 0
FOR i = 1 TO INT(RND * 5)
a(x + i, y) = 1
a(x, y - i) = 1
NEXT i
CASE 1
FOR i = 1 TO INT(RND * 5)
a(x + i, y) = 1
a(x, y + i) = 1
NEXT i
CASE 2
FOR i = 1 TO INT(RND * 5)
a(x - i, y) = 1
a(x, y - i) = 1
NEXT i
CASE 3
FOR i = 1 TO INT(RND * 5)
a(x - i, y) = 1
a(x, y + i) = 1
NEXT i
END SELECT
NEXT l
FOR row = 1 TO 19
FOR col = 1 TO 69
IF a(col, row) = 0 THEN
PRINT "#";
ELSE
PRINT " ";
END IF
NEXT col
PRINT
NEXT row
WHILE INKEY$ = ""
WEND
GOTO begin
Would you mind if I included this post at my development section?
With best regards,
Björn Bergström - dungeon...@swipnet.se
Dungeondweller RLG and Roguelike Development Articles at
http://home.swipnet.se/dungeondweller/index.htm
>Would you mind if I included this post at my development section?
Please do... by itself, it's a throwaway program, but if it generates
other good research, it will do some good.
Have fun
Alan