Questions tagged [game-of-life]

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

Filter by
Sorted by
Tagged with
6
votes
1answer
290 views

Python implementation of Conway's Game of life with Pygame

So I've started learning programming a few months ago and this is one of my first projects. The program works, but I feel like it's a bit slow compared to the other implementations of Conway's Game of ...
0
votes
1answer
148 views

Conway's Game of Life in JavaScript sprawling iterative function

I'm new to JS, React and functional programming and am trying to make the Game of Life in React. My cycle function looks like iterative sprawl but all my attempts to refactor have been equally bad. ...
0
votes
1answer
331 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 ...
3
votes
0answers
219 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: ...
1
vote
2answers
893 views

Conway's Game of Life class

This is a work in progress, I plan to use this class with OpenGL to make simulations look like they do on the Wikipedia page. I'm considering doing bounds checking when accessing my private member ...
8
votes
1answer
477 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 ...
5
votes
2answers
439 views

C++ Implementation of Conway's Game of Life with SDL2

This is my first attempt at using a visual library in C++, so for practice I decided to create the Game of Life utilizing SDL2; however, I would like help in terms of optimization and OOP. When ...
4
votes
2answers
236 views

Game of life - JavaScript

I would like to kindly ask others to review my code. I'd like suggestions, criticisms, and discussions on what is good and what could be done better. ...
3
votes
2answers
438 views

Class for Conway's Game of Life in C#

I have a class which takes a string representing a grid from Conway's game of life (along with its size, only accepting square grids) and returns the next grid in string format. Can it be improved? ...
4
votes
1answer
256 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 ...
2
votes
1answer
82 views

Game of Life component in React

I have been learning webdevelopment at Freecodcamp and have therefore been writing a lot of javascript by myself. They have a code-review chatroom, but the people in that chatroom seem to review the ...
5
votes
1answer
214 views

Conway's Game of Life in Win32/GDI

I've implemented Conway's Game of Life using the raw Windows API and GDI as an exercise. I'm wondering if there is room for improvement, though. Beware, large amount of code following: CGOL.h: <...
2
votes
1answer
63 views

My game of life implementation

I'm looking for comments on both the micro (individual lines of code) and macro (overall design) scale. My input/output format is a single string, with newlines delimiting rows and ...
8
votes
1answer
396 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. ...
4
votes
2answers
78 views

GameOfLife on GDX

I would like to know if I did everything right and if there a way to do it more simple and\or better? GameOfLife - main ...
2
votes
2answers
451 views

Java Game Of Life

my Java needed a little refresher so I implemented the Game of Life as a little excercise. The game is working as expected, but I'm sure there is some room for improvement. Here is the code (skipping ...
10
votes
1answer
3k 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 ...
2
votes
2answers
2k views

JavaScript implementation of Conway's Game Of Life With HTML5 Canvas

I've implemented Conway's Game Of Life with pure JavaScript and HTML5 Canvas. I'm not very good at JS patterns, so are there any ideas on how I can improve this code? For Online demo refer to this ...
4
votes
2answers
110 views

One of iteration Conway's Game of Life

I would really like to get some feedback on how you would improve my code's style, readability, and efficiency. I failed an interview recently and was unable to get any feedback so I thought I would ...
5
votes
1answer
533 views

Conways Game of Life in Swing, using OOP

I'm relatively new to coding and was wondering if anyone could review my code? I'm trying to get my head around the concepts of Object-oriented programming in particular. This is an implementation of ...
5
votes
2answers
709 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 ...
4
votes
2answers
195 views

Compact game of life implementation

I am learning F# and implemented Conway's Game of Life as an exercise (There are also other implementations on CodeReview). I have tried to forget all my object-oriented background and practice "...
3
votes
2answers
653 views

One-dimensional circular Conway's Game of Life

I have a program that is working, but it takes way too long to get the answer. With input like 15 100000000 111010111001100 The program checks for 15 numbers, ...
3
votes
3answers
4k views

Game of Life (Java)

This is a simple implementation of Conway's Game of Life in Java. The algorithm I use is inefficient however. Every Cell's neighbors (alive or dead) are checked on every iteration. ...
7
votes
5answers
480 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 ...
2
votes
0answers
655 views

Conways game of life with turtle python 3

A version of CGOL made in Python using the turtle module. Any suggestions for optimisations or improvement: ...
6
votes
2answers
471 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 ...
5
votes
2answers
328 views

20×20 Game of Life in C

I am new to C, but have experience with Python and R. The following code implements the Game of Life and represents my first finger exercise in C. I would like to have some feedback regarding the ...
1
vote
0answers
214 views

Java Console version of Conway's Game of Life

This is another out-of-the-head-and-into-the-compiler exercise. This was straight from the editor to code review. I would like suggestions on things to keep in mind when doing such exercises. ...
3
votes
2answers
881 views

Java console version Conway's Game of Life

I did a super simple version of Conway's Game of Life and would like a review. ...
5
votes
1answer
143 views

Game of Life Kata in Bash

I've implemented a Game of Life Kata with the aim to get to know Consul's K/V store. Although not the main purpose of the exercise, it would be nice if somebody reviewed some of the bash code in the ...
5
votes
2answers
269 views

Game of Life, a shorter story

I've been glancing at Game of Life for quite a while, but been reluctant towards graphical packages like pygame. But today I finally got over myself and did it. Did you know that there the "problem" ...
8
votes
1answer
943 views

Conway's Game of Life python

It's my implementation. Can I get some opinions on it? ...
6
votes
1answer
130 views

Game of Life implementation is too slow

I was tasked with implementing Conway's Game of Life. It seems to work fine but the implementation is lacking as I find that it takes a long time to generate the next generation of the grid. I'm ...
2
votes
1answer
5k views

Game of life in C

Game of life is the simplest example of zero player game for cellular automata and it was proposed by mathematician John Conway. I have tried to re implement Nicolas P. Rougier's tutorial for python ...
14
votes
4answers
9k 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, ...
8
votes
1answer
361 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 ...
5
votes
2answers
447 views

Functional Conway's Game of Life in JavaScript

In this code, I tried to integrate my little knowledge of (and great fascination towards) functional programming. I'd like to make this code more functional, and faster, if that's possible. ...
3
votes
1answer
2k views

Game of Life - Basic Java GUI Implementation

I've been working on a basic implementation of Conway's Game of Life over the last day, and I've just finished a 'playable' version. If anyone has the time, would you mind making any suggestions on ...
4
votes
1answer
1k views

My version of Conway's Game of Life in Java

I am currently only doing one generation. I'd like a review of my code. Game of Life: The universe of the Game of Life is an infinite two-dimensional orthogonal grid of square cells, each of ...
8
votes
1answer
309 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 ...
6
votes
1answer
438 views

Conway's Game of Life in Scala

To learn Scala, coming from Java and Python, I'm attempting to program an implementation of Conway's Game of Life. I've implemented two different approaches so far, with the first being so bad I'm ...
4
votes
1answer
1k views

Conway's Game Of Life in C#

In the C# Player's Guide book, one of the challenges was to make the game Game of Life in the console. Program.cs ...
9
votes
1answer
902 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 ...
2
votes
1answer
286 views

Conway's Game of Life Java Implementation

Keep state the same if it doesn't fall in the following conditions: Change to 2 if there are exactly 2 ones in the neighbors Change to 3 if there are more than 2 ones in the neighbors It is also ...
3
votes
1answer
2k views

Beginner's pygame Conway's Game of Life

Here's my implementation of Game of Life. I'm quite new to Python and would like to know how could I improve that code, especially in terms of performance, compactness and readability. ...
4
votes
1answer
86 views

Building blocks of Life

I'm learning Clojure, and decided to write a Conway's Game of Life clone as my starting project. I ended up dicking around for a bit before diving in, and came up with a few functions that I'd like ...
9
votes
1answer
32k 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 ...
4
votes
1answer
149 views

Conway's Game of Life in Python, saving to an image

I have attempted to make conways game of life in Python, and then save the output into a picture. Is there any way to make this more efficient? Is there anything wrong with the logic? (Most of the ...
14
votes
1answer
288 views

Conway's Game of Life in J

I have the following code which produces successive generations of Conway's Game of Life: ...