Questions tagged [cellular-automata]

A cellular automaton is a discrete model studied in computability theory.

Filter by
Sorted by
Tagged with
4 votes
1 answer
144 views

Langton's Ant cellular automaton in Java

I made a couple of little games and cellular automata in Java. For every new 'game', I used the same code as a base, except for the game logic of course. With every iteration of me customizing my ...
plankins's user avatar
4 votes
2 answers
540 views

How to implement a 2D Cellular Automaton in JavaScript?

So far I have this: ...
Lance's user avatar
  • 351
2 votes
0 answers
724 views

Google Foobar -Expanding Nebula - Code takes too long

So I'm on level 5 of Google Foobar, and the Question is Expanding Nebula. It goes as follows : Expanding Nebula You've escaped Commander Lambda's exploding space station along with numerous escape ...
Karthik Raj's user avatar
11 votes
3 answers
5k views

Algorithm for competing cells of 0s and 1s

I'm working on a practice algorithm problem, stated as follows: There are eight houses represented as cells. Each day, the houses compete with adjacent ones. 1 represents an "active" house and 0 ...
LuxuryMode's user avatar
2 votes
2 answers
375 views

Cellular automaton (Conway's Game of Life) in python

As a practice exercise, I implemented a cellular automaton (Conway's Game of Life) in python (with help from this tutorial). I am very curious, if this code follows common best practices and I am ...
user213544's user avatar
5 votes
1 answer
200 views

Game of Life in Rust-lang

I decided to implement Conways Game of Life for my first project using Rust. I also haven't had much code review ever, and have been looking for a good critique of my code so I can improve my skills. ...
Konnor Timmons's user avatar
1 vote
2 answers
405 views

Turing machine schoolwork

Our teacher doesn't give much feedback on our code itself. Was just looking for some feedback on how I could improve on this. This is the method that tests the string against the Turing machine that ...
Christopher D.'s user avatar
4 votes
1 answer
69 views

Langton's ant in Clojurescript

The weekly coding challenge in Eric Normand's newsletter this week involves implementing Langton's ant. I wanted something on my screen so I put together a simple re-frame app. The core functions ...
nakiya's user avatar
  • 235
3 votes
0 answers
397 views

Forest Fire Cellular Automata

I stumbled on the idea of a Forest Fire simulating cellular automata, and decided to try making a version using a full Seesaw UI (a Clojure wrapper over Java's Swing). A short sample of it running is ...
Carcigenicate's user avatar
5 votes
3 answers
2k views

Java Langton's Ant simulation

I have implemented a simulation which is called "Langton's Ant" with Java. Here is a short summary of basic rules: A ant is placed in a 2D matrix and looks to north, west, east or south. First, all ...
Marten's user avatar
  • 585
2 votes
3 answers
2k views

Simple version of the Game Of Life

This is just a very simple version of the Game of Life made in Java. Please let me know how I could have improved this. I am also hoping for some feedback on how the formatting and conventions are ...
joeyvanlierop's user avatar
1 vote
1 answer
128 views

Langton's Ant cellular automaton in Ruby

I wrote a Langton's Ant cellular automaton simulator in Ruby using object oriented principles. This code works. It requires the drawille library. I would like to ...
anna328p's user avatar
  • 308
0 votes
1 answer
384 views

Conway's Game of Life in React

I have built a version of Conway's Game of Life in React. If you don't know what it is, the Game of Life is a simple algorithm that causes patterns and shapes to appear in a 2D array of cells. While ...
DanielPahor's user avatar
3 votes
0 answers
330 views

Game of Life in Haskell with Nested Zippers, Comonads, etc

I was trying to implement Game of Life in Haskell. Here is my approach: ...
Agnishom Chattopadhyay's user avatar
3 votes
1 answer
219 views

One-Dimensional Cellular Automata

First, a teaser with an aweful gif! After watching the first couple minutes of The Coding Train's awesome video on Cellular Automata, I decided to try and write my own. I've written many versions of ...
Carcigenicate's user avatar
4 votes
1 answer
315 views

(SBCL) ASCII Game of Life

I'm implementing Conway's Game of Life in Lisp to familiarize myself with the language, with the eventual goal of hosting it on a website with a pretty GUI. I'm a hobbyist and inexperienced (this is ...
plishplop's user avatar
8 votes
1 answer
431 views

Grid displayer: Game of Life and Langton's Ant

Re-use Given that both the Langton's Ant and the Game of Life use a grid, I decided to code a generic grid_diplayer code and use it both for GoL (Game of Life) and ...
Caridorc's user avatar
  • 27.4k
3 votes
0 answers
214 views

CUDA program that emulates a kind of cellular automata slower on the GPU than on the CPU

I'm a very new to CUDA, so I'm still trying to understand how to make the best use of the GPU. I've ported a C algorithm to it. This algorithm works by loading the memory with an initial input, then ...
MaiaVictor's user avatar
  • 1,101
-5 votes
2 answers
104 views

Rewrite 12 consecutive ints based on bizarre logic

Despite looking terribly ugly, it is pretty interesting due to some specific connections to cellular automata theory. I'm looking for ways of simplifying it further. This program takes 2.7 seconds to ...
MaiaVictor's user avatar
  • 1,101
5 votes
2 answers
128 views

Finding if there exists an input for a given automata for which no matter what the starting state is, final state would be same everytime

I am solving a puzzle (Finding if there exists an input for a given automata for which no matter what the starting state is, final state would be same everytime) and have written following Python code....
h_t's user avatar
  • 51
0 votes
1 answer
130 views

Game of life C++ implementation memory access bug [closed]

I'm learning C++ so I thought I'd make game of life for practice and explore pointers, 1.5D arrays and stuff like that. I have "finished" my implementation, but I have trouble with memory access. It ...
Reygoch's user avatar
  • 135
3 votes
1 answer
75 views

Simulation of animal skins

This is a simulation of animal skins, like a cellular automat. I'd like it improved. ...
Siklos's user avatar
  • 31
4 votes
1 answer
4k views

Simple Cellular Automata (think Conway's Game of Life) simulator

Firstly, let me say that this code works, as posted. It fills a 10x10 grid with a random color (black/white) then runs a cellular automata simulation on the grid, starting or pausing when the button ...
ViggyNash's user avatar
  • 151
2 votes
1 answer
893 views

Performance problems with 1D cellular automata experiment in Python with Numpy

I'm an experienced programmer but relatively new to Python (a month or so) so it's quite likely that I've made some gauche errors. I very much appreciate your time spent taking a look at my code. My ...
otakucode's user avatar
  • 123
6 votes
1 answer
3k views

Generating a 1D cellular automata in Python

I wrote a program that generates a set of 1D cellular automaton. Basically, it generates this (rule 150): ...and rotates it to form this: I then introduced an element of randomness to it, so it ...
Michael0x2a's user avatar