Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
The results are in! See what nearly 90,000 developers picked as their most loved, dreaded, and desired coding languages and more in the 2019 Developer Survey.

Questions tagged [game-of-life]

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

43
votes
4answers
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 ...
40
votes
7answers
31k 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? ...
29
votes
1answer
3k 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 ...
25
votes
2answers
741 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 ...
21
votes
9answers
20k 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: ...
20
votes
6answers
10k 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 ...
14
votes
3answers
574 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 (...
14
votes
2answers
31k views

Conway's Game of Life in Python

Here's my Python implementation of Conway's Game of Life: ...
14
votes
1answer
261 views

Conway's Game of Life in J

I have the following code which produces successive generations of Conway's Game of Life: ...
13
votes
4answers
6k 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, ...
12
votes
1answer
25k views

Game of Life in Java

I wrote John Conway's Game of Life in Java: ...
12
votes
1answer
259 views

A Pythonic implementation of Conway's Game of Life

I've just finished implementing Conway's Game of Life in python-3.6: ...
12
votes
1answer
236 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 ...
11
votes
5answers
15k 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 ...
11
votes
2answers
1k 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. ...
10
votes
1answer
1k 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 ...
10
votes
1answer
247 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: ...
10
votes
1answer
3k views
9
votes
1answer
27k 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 ...
8
votes
1answer
810 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 ...
8
votes
1answer
270 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 ...
8
votes
1answer
245 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 ...
8
votes
4answers
822 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 ...
8
votes
1answer
774 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 ...
8
votes
1answer
779 views

Conway's Game of Life python

It's my implementation. Can I get some opinions on it? ...
8
votes
1answer
651 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 ...
8
votes
1answer
329 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. ...
8
votes
1answer
119 views

A Game of Life application, with mouse clicks

I have a Game of Life program that has a grid[][] array which is populated by Cell objects. If there's a cell in a grid square, ...
8
votes
2answers
2k 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 ...
8
votes
2answers
235 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#) ...
8
votes
1answer
304 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 ...
7
votes
2answers
649 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 ...
7
votes
1answer
2k views
7
votes
4answers
695 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-...
7
votes
2answers
217 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 ...
7
votes
2answers
173 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 ...
7
votes
1answer
477 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 ...
7
votes
5answers
438 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 ...
7
votes
1answer
7k views

Conway's Game of Life in Python3

I've implemented Game of Life in Python for a programming problem, in two different versions: one is a simple script and the other uses a class with a dictionary to initialize the various parameters. ...
7
votes
1answer
554 views

JavaScript implementation of Conway's Game of Life

It took some time to make Conway's Game of Life in HTML, CSS, JavaScript and jQuery. I'd like suggestions, criticisms, and discussions on how it can be done better. JSFiddle link ...
7
votes
1answer
235 views

Functional Game of Life implementation in Ruby

We ran a Code Retreat day at Hacker Paradise this Saturday, and I was pretty happy with my eventual solution. It's written in Ruby, but would work reasonably well in JS/CS and is (hopefully) ...
7
votes
1answer
3k views

Game of Life implementation in Haskell

I've written a small Game of Life module in Haskell, as well as a small testing application. I'm relatively new to the language, so any kind of comment about the code is welcome. The most important ...
7
votes
1answer
500 views

Conways game of life in Haskell

I started with Haskell some months ago, but didn't really use it since then. As a simple training I implemented Conways game of life. What/How could it be improved? ...
7
votes
1answer
513 views

Game of Life rules in 14 lines of Python

I've attempted a functional solution to Conway's Game of Life in Python. The example code allows you to see the next generation of the universe by calling the ...
7
votes
1answer
622 views

Moving Cell objects around a game field

I have a 20x20 field that contains Square objects. Each Square contains a Rectangle that is ...
6
votes
3answers
1k views

Python Conway's Game of life

One of my first serious Python programs, realized Conway's Game of Life in Python. Not sure that get_cell_state and update_table functions are good as they might be. Would be glad to see any ...
6
votes
2answers
1k views

Conways Game of Life in Java

I created a program in Java that showcases Conway's Game of Life, in 4 days. Created the algorithm from scratch. However I got a scathing review and left me scratching my head. This was for a job ...
6
votes
2answers
248 views

Parse Run Length Encoded file for cellular automaton data

I wanted to be able to parse Run Length Encoded (*.rle) files into something usable for a cellular automaton simulator (e.g. Conway's Game of Life and such). Here ...
6
votes
2answers
2k views

Garbage collection loop in Game of Life

I'm working on a Game Of Life clone as my first project. I'm still relatively new to programming, so my code is probably not really optimised. The biggest bottleneck is in my ...
6
votes
3answers
2k 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 ...