mirror of
https://github.com/gungwald/maze.git
synced 2024-09-25 06:54:51 +00:00
Made all segments non-overlapping
This commit is contained in:
parent
587da6f982
commit
4de38de2cb
6
maze.baz
6
maze.baz
@ -47,15 +47,15 @@ REM ///////////////////////////
|
|||||||
let mx = (int(sw / w) - 1) * w
|
let mx = (int(sw / w) - 1) * w
|
||||||
let my = (int(sh / h) - 1) * h
|
let my = (int(sh / h) - 1) * h
|
||||||
for y1 = 0 to my step h
|
for y1 = 0 to my step h
|
||||||
let y2 = y1 + h
|
let y2 = y1 + h - 1
|
||||||
for x1 = 0 to mx step w
|
for x1 = 0 to mx step w
|
||||||
if peek(kbd) > 127 then gosub @checkKeypress
|
if peek(kbd) > 127 then gosub @checkKeypress
|
||||||
let x2 = x1 + w
|
let x2 = x1 + w - 1
|
||||||
let T = INT(RND(1) * 2): REM Segment type
|
let T = INT(RND(1) * 2): REM Segment type
|
||||||
gosub @drawSegment
|
gosub @drawSegment
|
||||||
next
|
next
|
||||||
let x2 = sw - 1
|
let x2 = sw - 1
|
||||||
let dy = int((x2 - x1) * h / w)
|
let dy = int((x2 - x1 + 1) * h / w) - 1
|
||||||
let T = INT(RND(1) * 2): REM Segment type
|
let T = INT(RND(1) * 2): REM Segment type
|
||||||
let yb = y1: rem Backup y1
|
let yb = y1: rem Backup y1
|
||||||
if t = 0 then y1 = y2 - dy
|
if t = 0 then y1 = y2 - dy
|
||||||
|
Loading…
Reference in New Issue
Block a user