|
|
|
|
|
by logicchains
4683 days ago
|
|
Take the code here: https://github.com/logicchains/levgen-benchmarks/blob/master... and run it. Then, take the same code, change the genRooms function to contain: where
noFit = genRooms (n-1) (restInts) rsDone
tr = Room {rPos=(x,y), rw= w, rh= h}
x = rem (U.unsafeHead randInts) levDim
y = rem (U.unsafeIndex randInts 1) levDim
restInts = U.unsafeDrop 4 randInts
w = rem (U.unsafeIndex randInts 2) maxWid + minWid
h = rem (U.unsafeIndex randInts 3) maxWid + minWid
And change:let rands = U.unfoldrN 10000000 (Just . next) gen to: let rands = U.unfoldrN 20000000 (Just . next) gen The running time should double. Does it? Or does it increase by orders of magnitude? The latter is what happens to me. |
|