Questions tagged [game-of-life]

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

Filter by
Sorted by
Tagged with
44
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
32k 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? ...
30
votes
1answer
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 ...
25
votes
2answers
795 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
11k 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
4answers
7k 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, ...
14
votes
3answers
579 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
32k views

Conway's Game of Life in Python

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

Conway's Game of Life in J

I have the following code which produces successive generations of Conway's Game of Life: ...
12
votes
1answer
25k views

Game of Life in Java

I wrote John Conway's Game of Life in Java: ...
12
votes
1answer
284 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
246 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
16k 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
2k 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
302 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

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

...
9
votes
1answer
29k 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 ...
9
votes
1answer
772 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 ...
8
votes
1answer
812 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
277 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
4answers
718 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-...
8
votes
1answer
292 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
844 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
790 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
817 views

Conway's Game of Life python

It's my implementation. Can I get some opinions on it? ...
8
votes
1answer
658 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
352 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
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
246 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
323 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
656 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

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: ...
7
votes
2answers
218 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
249 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
526 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
447 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
572 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
242 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
517 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
559 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
137 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, ...
7
votes
1answer
708 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
293 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
3k 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 ...