Let's Have Some Fun with Game Of Life:& Learn to Think Functionally Along the Way
summary
Implements Conway’s Game of Life in Java with immutable transformations and live coding, not mutation. Uses an enum for cell states, Java records for coordinates, streams with flatMap to emit eight neighbor “signals,” then Collectors.groupingBy with groupingBy + counting to compute live neighbor counts. Builds a NextGeneration function driven by unit tests (zero, one, many cases like block and oscillator) and the code runs correctly under those tests.
AI-written summary · about
chapters (8)
- 0:00Introduction to the problem
- 2:03Rules and cell state model
- 8:10Implementing cell rules
- 14:36Modeling an infinite universe
- 25:06Code coverage and refactoring
- 35:01Generating neighbor signals
- 41:13Counting signals with grouping
- 48:31Testing and conclusion
related talks
35mCellular Automata How to become an artist with a few lines
40mCellular Automata: How to become an artist with a few lines of code
31mCELLULAR AUTOMATA: HOW TO BECOME AN ARTIST WITH A FEW LINES OF CODE
48mEmbrace the Func - How Far has Functional Programming Come in Java?
15mHow I Found the Meaning of Life Thanks to WebAssembly
10mGoLlURM! The Game of Life (limited) Unlimited-Register Machine!
38mFun with Functional Programming in Clojure
56mThe Aleph
