Commit d806c89e authored by Hugo Hörnquist's avatar Hugo Hörnquist
Browse files

Merge branch 'master' of git.lysator.liu.se:hugo/wolf3d

parents 4f66ae92 3f770d2f
(define-module (map)
:export (game-map board-height board-width))
(define (parse-map spec)
(let ((arr (make-array #f (length spec) (string-length (car spec)))))
(array-index-map! arr
(lambda (i j)
(case (string-ref (list-ref spec i) j)
((#\space) 'space)
((#\#) 'wall))))
((#\#) 'wall)
((#\:) 'grass)
((#\;) 'teleporter)
((#\*) 'window)
((#\%) 'entrance))))
arr))
(define game-map
(parse-map
'("########"
"# #"
"# ### #"
"# # #"
"########")))
'(
" ###### "
" # % # "
" # ####################"
" # % #"
" # #############%#%##"
" # # # # #"
" # % # # #"
" # #######****#**#**#"
"###%%###:::::::::::::::::"
"::* *:::::::::::::::::"
"::* *:::::::::::::::::"
"::* *:::::::::::::::::"
"::* *:::::::::::::::::"
"::* *:::::::::::::::::"
"::* *:::::::::::::::::"
"::* *:::::::::::::::::"
"::* *:::::::::::::::::"
"::* *:::::::::::::::::"
"::* *:::::::::::::::::"
"::* *:::::::::::::::::"
"::* *:::::::::::::::::"
"::* *:::::::::::::::::"
"::* *:::::::::::::::::"
"::* *:::::::::::::::::"
"::* *:::::::::::::::::"
"::* *:::::::::::::::::"
"::* *:::::::::::::::::"
" # ###**#*#**#**#**#**#"
" # % # # # # # # #"
" # ### # # # # # #"
" # ####%#%##%##%#%##%##"
" # % "
" ########################")))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment