Conway's Game of Life in Java + Processing
Автор: Barney Codes
Загружено: 2018-04-23
Просмотров: 12299
Описание:
Conway's game of life is a classic programming exercise. In this challenge I build Conway's Game of Life, which is a simple simulator using cells and one of the most iconic examples of Cellular Automaton. Black is used to represent 'alive' cells while white symbolises 'dead' cells.
In each generation the state of a cell is determined by the number of alive cells it is surrounded by in the previous generation. Too many and it will die from over population, too few and it will suffer under population. If a dead cell has the correct number of neighbours it can be brought back to life due to population expansion.
The cells are stored in an integer array (as different forms of cellular automaton use different rules and cell states, you could try coming up with your own!).
Hope you enjoy the episode!
0:00 - Intro
2:15 - Initialising the cells
4:18 - Drawing cells
8:37 - Drawing the grid
10:26 - Calculating neighbours
15:58 - Generations
20:15 - Simulation speed
23:25 - Pausing
24:45 - Adding/removing cells with the mouse
27:47 - Clear the screen
30:12 - Drawing the cursor
32:35 - Final product
Make sure to check out the links below, they've got everything you need to get started!
Check out the files from this challenge on github: https://github.com/BarneyWhiteman/Cod...
Get Processing from here: https://processing.org/
Check out the rest of the Coding Challenges here:
• Repelling Particles in Java + Processing
Follow me:
Support the channel: https://www.youtube.com/@BarneyCodes/...
Twitter: / barneycodes
Reddit: / barneycodes
#creativecoding #processing #java
Повторяем попытку...
Доступные форматы для скачивания:
Скачать видео
-
Информация по загрузке: