Discussion
Loading...

Post

Log in
  • About
  • Code of conduct
  • Privacy
  • About Bonfire
Stefan Siegert
Stefan Siegert
@safest_integer@mastodon.social  ·  activity timestamp 2 days ago

Genuary 2026 - 9: "Crazy automaton."

Modified Game of Life on a random Voronoi tesselation. A cell survives if it has exactly one neighbor, a new one gets spawned from exactly two neighbors. R code in alt text.

#genuary #genuary2026 #genuary9 #rstats #gameoflife

Your browser does not support the video tag.
GIF
GIF
# R code: Game of life on random 2d voronoi tesselation library(deldir) set.seed(1) n = 1000 pts = data.frame(x = runif(n), y = runif(n)) v = deldir(pts$x, pts$y) tiles = tile.list(v) edges = v$dirsgs[, c("ind1", "ind2")] neighbors = split(c(edges$ind2, edges$ind1), c(edges$ind1, edges$ind2)) state = rbinom(n, 1, 0.05) par(mar=rep(0,4)) while(1) { nb = sapply(1:n, function(i) sum(state[neighbors[[as.character(i)]]], na.rm = TRUE)) state = as.numeric(state + nb == 2) plot(0, 0, type = "n", xlim = c(0,1), ylim = c(0,1)) for (i in 1:n) { polygon(tiles[[i]]$x, tiles[[i]]$y, col = grey(1-state[i])) } Sys.sleep(.5) }
# R code: Game of life on random 2d voronoi tesselation library(deldir) set.seed(1) n = 1000 pts = data.frame(x = runif(n), y = runif(n)) v = deldir(pts$x, pts$y) tiles = tile.list(v) edges = v$dirsgs[, c("ind1", "ind2")] neighbors = split(c(edges$ind2, edges$ind1), c(edges$ind1, edges$ind2)) state = rbinom(n, 1, 0.05) par(mar=rep(0,4)) while(1) { nb = sapply(1:n, function(i) sum(state[neighbors[[as.character(i)]]], na.rm = TRUE)) state = as.numeric(state + nb == 2) plot(0, 0, type = "n", xlim = c(0,1), ylim = c(0,1)) for (i in 1:n) { polygon(tiles[[i]]$x, tiles[[i]]$y, col = grey(1-state[i])) } Sys.sleep(.5) }
  • Copy link
  • Flag this post
  • Block

BT Free Social

BT Free is a non-profit organization founded by @ozoned@btfree.social . It's goal is for digital privacy rights, advocacy and consulting. This goal will be attained by hosting open platforms to allow others to seamlessly join the Fediverse on moderated instances or by helping others join the Fediverse.

BT Free Social: About · Code of conduct · Privacy ·
Bonfire social · 1.0.1-beta.22 no JS en
Automatic federation enabled
Log in
  • Explore
  • About
  • Code of Conduct