Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bhiogade/assignmentc
Coditation
https://github.com/bhiogade/assignmentc
Last synced: 16 days ago
JSON representation
Coditation
- Host: GitHub
- URL: https://github.com/bhiogade/assignmentc
- Owner: bhiogade
- Created: 2021-08-03T06:51:24.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-08-06T13:03:21.000Z (over 3 years ago)
- Last Synced: 2023-10-30T10:32:53.800Z (about 1 year ago)
- Language: JavaScript
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
Imagine an infinite two-dimensional orthogonal grid of square cells, each of which is in one of two
possible states, live or dead. Every cell interacts with its eight neighbors, which are the cells that are
directly horizontally, vertically, or diagonally adjacent.
At each step in time (tick), the following transitions occur:
1. Any live cell with fewer than two live neighbors dies, as if by loneliness.
2. Any live cell with more than three live neighbors dies, as if by overcrowding.
3. Any live cell with two or three live neighbors lives, unchanged, to the next generation.
4. Any dead cell with exactly three live neighbors comes to life.
The initial pattern constitutes the 'seed' (randomly placed 500 cells) of the system. The first generation is
created by applying the above rules simultaneously to every cell in the seed — births and deaths happen
simultaneously, and the discrete moment at which this happens is called a tick. (In other words, each
generation is a pure function of the one before.)
Write a program in the language(s) of your choice with following guidelines:
1. Accept a user input of new cells (max 100 at every step/tick) to be placed; each cell should have a
unique name which is to be accepted by the user. This input can be accepted through a CLI or
HTML element or any other form of user interface
2. Acceptance of the user input represents a tick and program is expected to calculate the state of
every cell
3. The program should output the state of the cells and changes - representation (UI/CLI et al.) of
the state of the cells can be decided by the developer
4. The program should provide a way to search by the name of the cell and show the current state of
the cell
5. The program should end on termination through appropriate OS specific signals