Implements cellular automata, closes #13

This commit is contained in:
m
2023-07-23 13:45:25 -04:00
parent f5bd7c949a
commit a11e4fa5a1
6 changed files with 87 additions and 7 deletions

View File

@@ -1,4 +1,3 @@
require "math"
DrunkenWalk = {
curr_x = 0,
curr_y = 0,
@@ -8,9 +7,10 @@ DrunkenWalk = {
}
function DrunkenWalk:initialize(w, h)
math.randomseed(os.time())
math.randomseed()
self.map_w = w
self.map_h = h
self.iterations = 30
visualizer.map:fill(true)
self.curr_x = math.random(0, w-1)
self.curr_y = math.random(0, h-1);