Questions tagged [game-of-life]

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

Filter by
Sorted by
Tagged with
4 votes
2 answers
127 views

Game of life code in C++

Does my code for game of life look good enough? What changes can I make to optimize the code? I am a beginner to java and I've coded the Game of Life! For those not familiar, the game entails creating ...
ap0calypse's user avatar
12 votes
2 answers
2k views

Conway's Game of Life Terminal Visualization in C

I'm currently learning C, and decided to practice what I've been working on with a project, namely implementing Conway's Game of Life as a terminal visualization. This is my first project in C. The ...
joeymalvinni's user avatar
1 vote
1 answer
80 views

Conway's Game of Life In C++17

I implemented Conway's Game of Life in C++17. To make it easy to copy paste. I have merged my .h and ...
Ajinkya Kamat's user avatar
4 votes
2 answers
111 views

implementation of Conway's game of life in C for ansi terminals

I've been learning C for some quite time now and wanted to test my skills by implementing the game of life in C. Please give me a general review, and include the style. Is code like that of function ...
Hansoko's user avatar
  • 143
1 vote
1 answer
115 views

Algorithm for Conway's Game of Life in potentially infinite grid in Python

I implemented a program for computing Conway's Game of Life iterations in Python starting from an initial grid configuration given as input. It is intended to handle arbitrarily large grids. I tried ...
frix's user avatar
  • 357
2 votes
1 answer
127 views

Parallelization of the tick function in a Game of Life simulation using Rust and Python (+ NumPy)

I've been writing a small Rust module recently with the sole purpose of speeding up my Python program, which is a Conway's Game of Life simulation. The function written in Rust is called from Python ...
chubercik's user avatar
  • 123
8 votes
2 answers
280 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
2 votes
1 answer
93 views

Game of life(random generation, pygame)

I recently created game about life in python. First version of code was console, but recently I rewrote this game in pygame. I decied upgrade game and was added age of cells. But now I can see that my ...
Максим's user avatar
6 votes
2 answers
2k views

Game of life(random generation)

I wrote a simple game using python, but I wonder: how I can improve it? Any opinions will be useful. I thought about optimization, since the program consumes 20% processor resources, but don't know ...
Максим's user avatar
4 votes
2 answers
277 views

Multithreaded Conway's Game of Life implementation written in C and Java using JNI

I had some multithreading C programming experience from school last year but I wanted a bit more so I tried to program a Conway's Game of Life implementation from scratch. Code is mainly written in C ...
Shmuel Newmark's user avatar
4 votes
1 answer
155 views

An implementation of Conway's Game of Life using C++ and SFML

I recently started learning C++ again, and I wrote a simple version of Conway's Game of Life. This version doesn't use 2 buffers to transfer changes over to the main view. Instead, it uses a stack of ...
imapyromain's user avatar
7 votes
1 answer
678 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
  • 371
8 votes
3 answers
396 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
3 votes
2 answers
149 views

Game of life with options like windows and board size

Mainly I am looking for a better way to control the user input in the game loop which is in the first file. Since the nested switch with many ...
yolo expectz's user avatar
9 votes
6 answers
5k 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
1 vote
1 answer
287 views

Conway's Game of Life in C++ with a Board Struct

I made the game of Life in C++ for a highschool class project. The website we're using doesn't have an autograder for C++, and my programming teacher doesn't really know how to program... so I'd love ...
digital_drako's user avatar
1 vote
0 answers
39 views

Using React Native to implement Conway's Game of Life

I'm using React Native to implement Conway's Game of Life as a mobile phone app. So far I've implemented the game logic and a main screen with an embedded GLView component where the game board is ...
Ste1891's user avatar
  • 31
2 votes
2 answers
1k views

Improving the Conway's Game of Life Code With Functions in Python

This query is a part of Conway’s game of life. Currently, this program takes about 70 lines of code in Python to return the functionality of the game, which can be simplified to fewer lines of code ...
Brando's user avatar
  • 37
3 votes
1 answer
328 views

Conway's Game of Life in Powershell

I'm learning PowerShell for professional development, but decided to do a bit of a silly project to help learn scripting in more depth, and chose Conway's Game of Life. This is the first PowerShell ...
Carcigenicate's user avatar
3 votes
1 answer
189 views

Game of Life in Clojure

I've implemented a Game of Life in Clojure and would like to understand what I can do better, especially in terms of idiomatic Clojure (without losing readability/maintainability) of the current ...
Christian Hujer's user avatar
6 votes
2 answers
256 views

Conway's game of life as Java OO with underlaying array

Well, there are many game of life's already, but after posting an answer on it in C#, I thought I might as well check if I did any better and if there is anything new to learn - there always is. ...
Maarten Bodewes's user avatar
2 votes
1 answer
191 views

Conway's Game of Life in a C# class. Is this sensibly factored and well tested?

I'm learning C# and have written the below class to encapsulate the game state of Conway's Game of Life and its update methods. I'm also learning about implementing light automated unit tests for ...
Ste1891's user avatar
  • 31
4 votes
2 answers
254 views

Game Of Life program in Java

I wrote a program for Conway's Game Of Life in Java. Are there any improvements I could make? main class: ...
MichaPehlivan's user avatar
2 votes
0 answers
33 views

One data object instead of array of objects - why is it slower?

I'm currently writing a game of life with small extra features but I ran into a problem - in my first try i decided to use simple list of Cell objects: ...
kucu's user avatar
  • 21
3 votes
1 answer
558 views

Simple terminal Game of Life in Rust

I've been learning Rust for a few weeks in my free time, and as a first project I decided to make a simple terminal Game of Life program (without UI, that might come later). It just starts with a ...
Francisco Gallego Salido's user avatar
2 votes
1 answer
344 views

Game of Life in C/SDL2

My first project in C/SDL2 after completing a short tutorial coding Pong. These 2 projects are my entire experience with both C and SDL2, although I had some previous basic experience with Python. I ...
Togiodi's user avatar
  • 23
1 vote
1 answer
266 views

my implementation of conway's game of life in C++

I found Conway's game of life. I had heard of it, of course, but didn't think it would be so easy and fun to implement. Anyway, here's my code which I know needs a lot of polish: ...
giorgi shengelaia's user avatar
1 vote
0 answers
90 views

Game of Life in TypeScript React

This is my first React project. I've included the main files that don't just contain boilerplate. This is a visualization of Conway's Game of Life, with a few toggleable features like starting/...
L292092's user avatar
  • 419
6 votes
1 answer
373 views

Conway's Game of Life - Javascript

Conway's Game of Life Conway's Game of Life is a mathematical game invented by English Mathematician John Horton Conway. The game is based on the theory of cellular automatons. It is a so-called zero-...
user avatar
7 votes
2 answers
215 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
12 votes
4 answers
3k views

Conway's Game of Life in C

My programming background is mostly C++/C#. Lately i got interested in writing some C. So i implemented Conway's Game of Life using SDL2 for visualization. This is actually my first program written in ...
Eric's user avatar
  • 389
6 votes
1 answer
774 views

Simulation of Conway's Game of Life with periodic boundary conditions

This is exercise 2.4.20. from the book Computer Science An Interdisciplinary Approach by Sedgewick & Wayne: Implement a class that simulates Conway’s Game of Life. One thing to note: I did not ...
Khashayar Baghizadeh's user avatar
4 votes
0 answers
224 views

Game of Life, thread per cell

In an effort to learn Java's support for concurrency I solved a self-imposed exercise to write a Game of Life simulator in Java, running a separate thread for each cell. Here is my code: ...
gaazkam's user avatar
  • 561
6 votes
3 answers
703 views

LIFE in Python 3

I have started to learn Python and have chosen Conway's game of life as my first program. I would be interested in reading how to write more idiomatic Python. Also, what threw me off for some time was ...
p.vitzliputzli's user avatar
5 votes
0 answers
259 views

Yet another implementation of Conway's Game of life in Haskell

(Sorry for my bad English) Hi, I'm interested in getting feedback of my own implementation of Conway's Game of Life. Some details: Uses gloss for animation Uses rio for shorter dependency list My ...
smb374's user avatar
  • 51
3 votes
1 answer
900 views

Game of life GUI simulation using java.swing

I am fairly new to GUI programming and I am interested in improving my code from every aspect. Performance, security, readability, conciseness, and the look-and-feel aspects are all important to me. ...
BovineScatologist's user avatar
3 votes
0 answers
291 views

Game of Life in Kotlin

I've implemented a Game of Life in Kotlin. There are some major requirements on this solution: Purely object-functional production code. As close to an infinite universe as possible. File ...
Christian Hujer's user avatar
5 votes
3 answers
3k views

Learning C: Conway's Game of Life

I'm learning C, so as a practice problem I implemented Conway's Game of Life. For anyone unfamiliar, the problem is set out here. To summarize, there is a grid of "cells" that can be either alive or ...
evamvid's user avatar
  • 161
5 votes
2 answers
8k views

Java: Conway's Game of Life

I have just finished implementing a version of Conway's Game of Life using Java. Being only a college student, I am sure that my code is no where near perfect, and was wondering if you could look at ...
jjjjjjjjjjjj's user avatar
3 votes
1 answer
337 views

Conway game of life implemented with C++/OpenCV

Here is an implementation of Conway's Game of Life. It is kind of a brute force but it works fine. I have a special question about the method cv::Mat render() const,...
curiouscupcake's user avatar
4 votes
1 answer
153 views

A very fast Game of Life

The rules of John Conway's Game of Life are simple: An OFF pixel that has 3 live neighbours is turned ON. An ON pixel that has anything other than 2 or 3 live neighbours is turned OFF. Many people ...
Sep Roland's user avatar
  • 4,408
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
2 votes
0 answers
101 views

Why does my Clojure implementation of Conway's Game of Life run so much slower than my Java implementation?

I'm trying to learn Clojure coming from a Java background. I have written a simple implementation of Conway's game of life in both Clojure and Java, trying to keep the overall structure of the code as ...
clojHalp3k's user avatar
3 votes
2 answers
208 views

Rust Conway's Game of Life: struct Board(Vec<Vec<Cell>>)

What do you think of using struct Board(Vec<Vec<Cell>>)? It's nice that I can attach the Display trait, and just ...
mb21's user avatar
  • 133
3 votes
1 answer
754 views

Conway's game of life in C++ using SDL2

I finally finished my Conway's game of life in c++ project and i'd love to find out how to improve the code. main.cpp ...
Nadpher's user avatar
  • 889
2 votes
1 answer
248 views

Arduino Conways Game of Life using FastLED

So I attempted to write Conway's game of life on an Arduino and display using the FastLED library. I use a custom bitset class to manage the game board state. I'm looking for feedback on performance, ...
HSchmale's user avatar
  • 895
2 votes
0 answers
226 views

Conway's Game of Life in Emacs Lisp

I decided it would be fun to implement Conway's Game of Life (CGOL) in Emacs Lisp as my first elisp script. My goals for the implementation were pretty simple Transform current buffer into the next ...
mjgpy3's user avatar
  • 729
6 votes
2 answers
1k views

Java implementation of Conway's Game of Life with GUI

I've implemented the Conway's Game of Life in Java, including a GUI. Here's the code of the two classes I wrote: GameOfLife.java ...
user avatar
0 votes
1 answer
94 views

Implementation of Conway's Game Of Life on Android

I ended up using 2x 2D arrays with a one element border around everything to simplify the kernel logic. ...
John Casey's user avatar
7 votes
3 answers
2k 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

1
2 3 4 5