![]() The game is played on a grid of cells, and each cell can be either alive or dead. It is a zero-player game, meaning that the evolution of the game is determined solely by its initial configuration. ![]() Also, my PC at that time did not have minesweeper for some reason, and I missed it very much. Conway's Game of Life is a classic cellular automaton and simulation game created by mathematician John Horton Conway. For full detailed instructions, I believe there's a readme file in there.Īnd minesweeper is pretty standard, I was just bored one day and decided to recreate it in Java. To make it more realistic, I believe there's an 80% chance of the eradication/copulation of a new cell working, although if you double click on a single cell it will be 100%. The project was the 3rd Assignment of the Parallel and Distributed Systems course of the Electrical and Computer Engineering Department of the Aristotle University of Thessaloniki. Oh yea, and I forgot to mention you can left click and right click to add and delete cells. This repository contains an implementation of Conways Game of Life in C++ and CUDA Code by Vassilis Choutas and Konstantinos Chamzas. Try loading the gosper_glider_gun as an example. The game is quite interesting, me and my friends spend a long time watching black and white patterns on our computer screen grow, as well as trying different configurations to see what kind of life forms you can get. I use the standard rules that Conway originally proposed, however you can change these by modifying code in the advance method (inside the Colony.java file), and the size of the game can be specified in the constructor (I left a little comment on specifics of the parameters). Just run the Main.java file in the src folder for both programsĬonway's game of life is a simulation proposed by Conway, and has some interesting mathematical patterns, feel free to look inside the code and change things up a little to experiment. (The fact that I'm writing this first post on April 1 is mostly unintentional. Hey guys, just thought I'd like to submit some programs I made back in my ICS class. This is the first in a series of posts (,, , ) implementing digital logic gates on top of Conway's game of life, with the final goal of designing an Intel 4004 and using it to simulate game of life. ![]() Posted: Wed 6:07 pm Post subject: Conway's Game of Life and Minesweeper You might think that dividn up a 10,000*10,000 spae into subspaces of 8*8 is a lot os tasks - but accumulating their states values is in fact much, much less computing work than performing the GoL algo to each cell plus their 8 neighbours plus comparing the number and storing the new state for the net iteration somewhere.īut like i said above, for a random init state with 30% population this wont make much sense, as there will be not many completely dead 8*8 subspaces to find (leave alone dead 256*256 subpaces)Īnd of course, the way of perfect optimisation will last but not least depend on your language.Wiki Blog Search Turing Chat Room Members When you are finished assigning the "has life" attribute to all possible subspaces, you end up with a list of subspaces which you now simply extend by +1 to each direction - with empty cells - and perform the regular (or modified) game of life rules to them. Only spaces which "have life" need to be divided into smaller subspaces - the empty ones can be skipped. Whenever you find life, you mark these subspaces as "has life". You could go down to subframes of 8*8 or 10*10 (not sure what makes the most sense here) now. If its sum of states is >0, you will now divide up the second quarter into 4 pieces again - and repeat this check for life for each of these subspaces. So if you have a field of 10,000 * 10,000, you´d first accumulate the states of the upper left quarter of 5,000 * 5,000.Īnd if the sum of states is zero in the first quarter, you can ignore this first quarter completely now and check the upper right 5,000 * 5,000 for life next. I would just divide the matrix up into halves and start checking the bigger ones first. I also use SFMLs Vector classes for convenience. Im using SFML 2.5.1 for a graphics library and CMake. ![]() Im my opinion it can make sense to check for completely dead spaces first, when your initial state is something like "random, but with chance for life lower than 5%." Here is my implementation of Conways Game of Life in C++ which takes advantage of multi-threading. The rules: The grid must be at least 20x20. If the majority of cells is dead, you could save a lot of CPU time by skipping empty parts and not calculating stuff cell by cell. Your mission, should you choose to accept it, is to code the shortest Game of Life implementation in your favourite language. What is the most efficient algo mainly depends on the initial state.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |