As of May 31, 2023, we have updated our Code of Conduct.

Questions tagged [game-of-life]

A cellular automaton simulation following rules devised by mathematician John Conway.

Filter by
Sorted by
Tagged with
47 votes
4 answers
8k views

Conway's Game of Life in JavaScript

I made Conway's Game of Life in JavaScript and was hoping someone could give me some pointers regarding my logic of checking adjacent cells. I know there must be a better way, but at the same time, it ...
SaggingRufus's user avatar
43 votes
7 answers
45k views

Conway's Game of Life in C++

This is my attempt at Conway's Game of Life. It works, and it's the most complicated program I've made to date. I'm sure it's pretty poorly done. Any ideas on how I can improve on it? ...
Twooey's user avatar
  • 974
35 votes
1 answer
4k views

Full-color clone of Conway's Game of Life, with a decent GUI

I wrote this to learn JavaFX, and as an excuse to re-make the Game of Life. This is the most complex GUI I've ever written, so I'd like feedback mainly on it, but I'll welcome any criticism! My ...
Carcigenicate's user avatar
28 votes
2 answers
945 views

Life is a Game - Play it

I haven't made a game in Excel yet, so I decided to Make Conway's Game of Life. If you wish to play along, I've uploaded the workbook here. Right now it's very rudimentary (No user interface, no ...
Kaz's user avatar
  • 8,800
23 votes
6 answers
13k views

Optimize Conway's Game of Life

I have coded up an implementation of Conway's Game of Life and I have a performance bottleneck in it which I wish to be optimized. The main logic is in the Universe ...
Adam Arold's user avatar
22 votes
9 answers
30k views

Checking for neighbours more elegantly in Conway's Game of Life

My method for counting neighbors in my soon-to-be Game of Life implementation is very repetitive and I was wondering if this could be done more elegantly: ...
11684's user avatar
  • 467
16 votes
2 answers
36k views

Conway's Game of Life in Python

Here's my Python implementation of Conway's Game of Life: ...
Tim Vermeulen's user avatar
15 votes
3 answers
3k views

A Haskell implementation of Conway's Game of Life, viewable on the console, no external libs

This is a Haskell implementation of Conway's Game of Life. It plays on a console. It should be able to play a field of any size, but we only give it a glider on a small field to run at this point. ...
Aaron Hall's user avatar
  • 1,558
14 votes
4 answers
12k views

'Game of Life' in C#

Unrelated to code: I have only been programming for three weeks, and this is my first project. About the code: Uses a preset grid. It was all done on a single page. This, I realise, was a mistake, ...
OnePiece's user avatar
  • 185
14 votes
3 answers
624 views

Suggestions needed after modification of Simulation of an Ocean

After suggestions given in this question, modifications to the code has been done. Only thing I could not do is to decide, where to place the starveTime property (...
overexchange's user avatar
  • 3,321
14 votes
2 answers
361 views

Conway's Game of Life in J

I have the following code which produces successive generations of Conway's Game of Life: ...
Vivek Ramanujan's user avatar
13 votes
1 answer
390 views

A Pythonic implementation of Conway's Game of Life

I've just finished implementing Conway's Game of Life in python-3.6: ...
coldspeed's user avatar
  • 395
12 votes
5 answers
5k views

Coded the Game of Life

I am a beginner to java and I've coded the Game of Life! For those not familiar, the game entails creating a grid of specified dimensions with each box in the grid being either dead or alive. The grid ...
Karam Thethy's user avatar
12 votes
1 answer
25k views

Game of Life in Java

I wrote John Conway's Game of Life in Java: ...
LazySloth13's user avatar
  • 1,301
12 votes
1 answer
297 views

Generalized 2D cellular automata simulator

This is a simple Game of Life implementation, with one neat gimmick: You can specify the rules that the simulator uses to decide whether cells should live or die. Congrats, God! I'd especially like ...
Nic's user avatar
  • 5,473
11 votes
5 answers
17k views

Minimal Game of Life in C#

I want to learn how to write clean code from the start. This is my first project, a 'Minimum Viable Product' implementation of Conway's Game of Life in C#. Mostly I want to know if my code is ...
Santiago Gil's user avatar
11 votes
2 answers
2k views

Game of Life in Haskell

I wondering what people think of this game of life. I don't think it is working properly, but I am interesting in what people think of the general design. ...
Jonathan Fischoff's user avatar
10 votes
1 answer
5k views

Game of Life with NumPy

I started this exercise with NumPy with a goal to find neighbors and return the new matrix. I want to get your feedback. Here's an example from this website. It looks like it's \$O(N^2)\$, and I'm ...
gogasca's user avatar
  • 601
10 votes
1 answer
35k views

Simple Conway's Game of Life implementation in Java

I wrote a simple implementation of Conway's Game of Life in Java using 2 arrays and for loop and used StdDraw library for plotting generations. It turned out that ...
snowfinch27's user avatar
10 votes
1 answer
588 views

Conway's Game of Life implemented in Python

I'm a Python novice and decided to give Game of Life a try in Python 3: ...
user avatar
10 votes
1 answer
4k views

Python implementation of a wrapped Conway's Game Of Life board

...
Macha's user avatar
  • 203
9 votes
6 answers
4k views

Conway's Game of Life Object oriented implementation in Java

I have designed Conway's Game of Life in Java, the solution follows Object Oriented design and paradigm, please review and let me know the feedback Class Cell Cell ...
HariHaravelan's user avatar
9 votes
1 answer
1k views

Conway's game of life in C++ with SDL

This is my attempt at a basic implementation of GOL. The user can add and remove cells with the mouse and some basic stats are printed to console. Any feedback is welcome, but I have a couple of ...
Andrew Hickman's user avatar
8 votes
3 answers
227 views

Optimise Game of Life in Rust

I recently picked up Rust and was making a CLI for Conway's Game of Life. I got it working but, looking back at it, there are places it could be improved. The main one is the function that generates ...
myster's user avatar
  • 83
8 votes
1 answer
835 views

First Java program critique (Game of Life)

As a school project in my navigator 12 class, I've decided to try and learn Java. I thought that I'd try and make the Game of Life, because it would be a good way to start learning Java (watched a ...
josephyoungh's user avatar
8 votes
1 answer
354 views

Game of Life in Scala with a sparse representation

While reviewing another Scala implementation of the Game of Life, I ended up drastically rewriting it. The board is represented as a Set[(Int, Int)] containing the ...
200_success's user avatar
8 votes
2 answers
150 views

Reverse Game of Life

I have written code to take a cellular automaton configuration and determine a state that could have existed one time-step prior, according to Game of Life rules. The algorithm goes roughly as follows:...
SirPython's user avatar
  • 13.3k
8 votes
4 answers
1k views

Another Conway's Game of Life Simulation (With colored populations!)

This is my near-final version of Conway's Game of Life, with inherited colors using PDCurses. Any new spawned cells take on the most frequent color surrounding it when it spawns. This leads to single-...
Carcigenicate's user avatar
8 votes
1 answer
924 views

SDL2.0 Conway's Game Of Life

Yet another Game Of Life implementation code review question I am attempting to learn SDL, and have a general (beginner) knowledge of c++. I am not a developer by trade so I expect my ...
NickH's user avatar
  • 131
8 votes
4 answers
1k views

Python Implementation - Conway's Game of Life

This is my implementation of Conway's Game of Life in Python. Now since I am a novice coder, naturally I have some key doubts: The usage of idioms and code redundancies - Are there any small ...
Ishaan Saxena's user avatar
8 votes
2 answers
1k views

Conways Game of Life in cmd batch file

Just for fun I have written a Conway's Game of Life in cmd batch file. I like writing in batch - its restrictions and limits are its appeal. However - it is slow, very slow on a large grid. Any tips ...
chazjn's user avatar
  • 633
8 votes
1 answer
877 views

Game of Life - OOP and Best Practices

I always have a problem figuring out what good JavaScript coding practices and conventions are and if I'm following them, especially concerning OOP. So I implemented The Game of Life and wanted to ask ...
tim's user avatar
  • 25k
8 votes
1 answer
1k views

Conway's Game of Life python

It's my implementation. Can I get some opinions on it? ...
Stepan Vanzuriak's user avatar
8 votes
1 answer
703 views

Game Of Life optimization in Java

I've been working on a version of Conway's Game of Life for about a week now. It has loads of features like drawing onto the screen and saving/loading images. The problem is that ever since I added ...
SullyJHF's user avatar
8 votes
1 answer
619 views

Game of life in kivy python

I coded a simulator of the Game Of Life by Conway. I made using Kivy, so that it has a graphical interface. Any suggestion on how to improve its pythonism or performance would be highly appreciated. ...
JPYamamoto'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
8 votes
2 answers
3k views

Graphics in Conway's Game of Life in Java

I recently coded a program to stimulate Conway's Game of Life. Originally, my program just printed an array of 1's and 0's where the 1's represented the "live" cells, but I tried to teach myself some ...
Jared's user avatar
  • 721
8 votes
2 answers
308 views

Conway's Game of Life F#

I am a C# developer learning F#. Would appreciate any suggestions on how this code can be improved. Main points I am interested in: Functional style of the code, absense of imperative style(C#) ...
Andrew Boklashko's user avatar
7 votes
2 answers
697 views

Feedback on my Conway's Game of Life

I've been programming for about 4 months now, just trying to learn by myself. I've tried my way with coding the Game of Life here, would like some general feedback as well as some pointers on how I ...
Overly Excessive's user avatar
7 votes
3 answers
1k views

Optimizing Conway's Game of Life in C++

How could I further optimize my implementation of Conway's Game of Life? And how would you critique my current strategies? I'm taking a C++ optimization class, the deadline has passed and my ...
Matt's user avatar
  • 105
7 votes
1 answer
2k views

Optimizing very simple piece of “Game of Life” code by taking advantage of NumPy's functionality

Here is the code as it stands right now: ...
bzm3r's user avatar
  • 399
7 votes
2 answers
247 views

Conway's Game of Life - Conventional JavaScript?

I'm using the Game of Life Kata to help me learn JavaScript. I've picked up the syntax through Codecademy tutorials, but my current skill level is Novice. The example code has working functionality ...
doughgle's user avatar
  • 619
7 votes
2 answers
3k views

Multi-threaded Conway's Game of Life in C++

Here is my implementation of Conway's Game of Life in C++ which takes advantage of multi-threading. I'm using SFML 2.5.1 for a graphics library and CMake. I also use SFML's ...
Kyle V.'s user avatar
  • 173
7 votes
1 answer
800 views

(Yet Another) Conway's Game of Life in Haskell (Naive)

I code Haskell as a hobbyist. I'm interested in feedback on my naive implementation of Conway's Game of Life. Specifically, as stated in the Quick Tour of the website, I am interested in: Best ...
Jeff Maner's user avatar
7 votes
3 answers
3k views

Implementing Conway's Game of Life

Here is an implementation of Conway's Game of Life. My code is working fine but I want you to review and give me your suggestions of how to improve it. These are the steps of my code: Initialize the ...
Mo Moallim's user avatar
7 votes
1 answer
563 views

John Conway's Game of Life in C++

I have created Game of Life in C++ SFML. The code works just fine. However since I am not used to working with C++, I implemented a lot of stuff the way I would in python (for example I have not used ...
Doruk's user avatar
  • 73
7 votes
2 answers
193 views

Game of Life state calculation in javascript

I've created a Game of Life implementation in JavaScript with the goal of having it be as fast as possible, with the rendering I'm satisfied (see picture bellow), however the next state calculation is ...
Noel Nemeth's user avatar
7 votes
1 answer
172 views

Game of life in Go

I wrote the Game Of Life algorithm with Go. There are a million ways that we can implement the algorithm, but I want to know is it implemented in good-way or not? I wonder how can I improve the ...
Saeed M.'s user avatar
  • 423
7 votes
5 answers
535 views

Conway's Game of Life and Other Lifelike Cellular Automata Rules

This simulator visualizes Conway's Game of Life and other lifelike cellular automata rule-sets. Features: You can choose from any of the preselected birth/survival thresholds or specify custom ...
Thriggle's user avatar
  • 1,308
7 votes
2 answers
320 views

Simulation to find max population of R-pentominos in Game of Life

I'm brand new to Python and I feel my code is really like what coded in Java. I try to practice python by small problem and that is to find the maximum population of R-pentomino. Wiki says: ...
Sayakiss's user avatar
  • 195

1
2 3 4 5