-
Notifications
You must be signed in to change notification settings - Fork 15
The New Turing Omnibus Chapter 44 Cellular Automata
As Conway's Game of Life is the exercise suggested for use during a Code retreat we ran this meeting as a practical event.
First we talked through what cellular automata are and why they are interesting to give everyone a introduction to the topic if they hadn't read the chapter. During this we mentioned the "Simulating the World (In Emoji)" blog post by Nicky Case and the recent discovery of a new kind of "spaceship".
We then set ourselves a time-limit of 20? minutes to build a game of life as a mob. Murray did the typing while the rest of the group provided the implementation. We decided to use ruby and proceed without tests and managed to get it working just as the bell rang. We spent some time afterwards going through what we'd done to explain any tricks and what the trade-offs might be. For example we used a single dimensional array instead of a nested one to hold the "grid" which would make bounds checking harder, but because we had ruby's negative array indices it didn't matter (although that does give us a slightly odd wrap around).
Our implementation can be found at https://github.com/computationclub/game-of-life/tree/master/the-club
After this we broke up into pairs to build another implementation but this time choosing a constraint to challenge us. At a full-day code retreat you build game of life a couple of times with no constraints to give you a familiarity with the game then for the rest of the day you build it again each time with a new constraint. The constraints allow you to break out of your comfort zone and explore new ways of programming, new tools, new ways of collaborating; each time you focus just on the constraint as by this stage you know how to build game of life pretty well.
We looked at the list of suggested constraints before breaking up into our pairs, but ultimately left it up to each pair to choose their own constraint.
After 20 minutes of typing it was clear each pair was invested in getting further in their implementation so instead of stopping we opted to check-in after another 10 minutes. These 10 minutes flew past but we were all "really close, can we just have another 10 minutes please?" so we agreed to keep going. In a traditional code retreat the 20 minutes per session is a hard limit as the goal is not to complete the implementation, just to explore the constraint. We weren't going to have time to run another session allowing exploring another constraint so running one long session allowed us some small sense of victory over our chosen constraints.
As we were close to the end of the meeting we decided 40 minutes for the session was enough so we stopped the coding and let each pair describe their implementation and constraint. As it turns out most pairs chose a programming constraint, either "no arrays" or "no conditionals". Hearing about the different approaches each team took to working around the same constraints gave us plenty of food for thought.
You can find our implementations in this repo.
We also had time for a quick retro about the code retreat process. Many pairs found that they spent a lot of time getting the infrastructure of the game out of the way before they could focus on the logic of the game where they could really embrace (or avoid) their constraint. We wondered if a test harness or incomplete implementation would have helped, or if these would have just acted as external constraints (e.g. that you had to use tests, or had to use the language they were written in).
Thanks as ever to Leo and Geckoboard for providing the venue and fetching the drinks.
- Home
- Documentation
- Choosing a Topic
- Shows & Tells
- Miscellaneous
- Opt Art
- Reinforcement Learning: An Introduction
- 10 Technical Papers Every Programmer Should Read (At Least Twice)
- 7 More Languages in 7 Weeks
- Lua, Day 1: The Call to Adventure
- Lua, Day 2: Tables All the Way Down
- Lua, Day 3
- Factor, Day 1: Stack On, Stack Off
- Factor, Day 2: Painting the Fence
- Factor, Day 3: Balancing on a Boat
- Elm, Day 1: Handling the Basics
- Elm, Day 2: The Elm Architecture
- Elm, Day 3: The Elm Architecture
- Elixir, Day 1: Laying a Great Foundation
- Elixir, Day 2: Controlling Mutations
- Elixir, Day 3: Spawning and Respawning
- Julia, Day 1: Resistance Is Futile
- Julia, Day 2: Getting Assimilated
- Julia, Day 3: Become One With Julia
- Minikanren, Days 1-3
- Minikanren, Einstein's Puzzle
- Idris Days 1-2
- Types and Programming Languages
- Chapter 1: Introduction
- Chapter 2: Mathematical Preliminaries
- Chapter 3: Untyped Arithmetic Expressions
- Chapter 4: An ML Implementation of Arithmetic Expressions
- Chapter 5: The Untyped Lambda-Calculus
- Chapters 6 & 7: De Bruijn Indices and an ML Implementation of the Lambda-Calculus
- Chapter 8: Typed Arithmetic Expressions
- Chapter 9: The Simply-Typed Lambda Calculus
- Chapter 10: An ML Implementation of Simple Types
- Chapter 11: Simple Extensions
- Chapter 11 Redux: Simple Extensions
- Chapter 13: References
- Chapter 14: Exceptions
- Chapter 15: Subtyping – Part 1
- Chapter 15: Subtyping – Part 2
- Chapter 16: The Metatheory of Subtyping
- Chapter 16: Implementation
- Chapter 18: Case Study: Imperative Objects
- Chapter 19: Case Study: Featherweight Java
- The New Turing Omnibus
- Errata
- Chapter 11: Search Trees
- Chapter 8: Random Numbers
- Chapter 35: Sequential Sorting
- Chapter 58: Predicate Calculus
- Chapter 27: Perceptrons
- Chapter 9: Mathematical Research
- Chapter 16: Genetic Algorithms
- Chapter 37: Public Key Cryptography
- Chapter 6: Game Trees
- Chapter 5: Gödel's Theorem
- Chapter 34: Satisfiability (also featuring: Sentient)
- Chapter 44: Cellular Automata
- Chapter 47: Storing Images
- Chapter 12: Error-Correcting Codes
- Chapter 32: The Fast Fourier Transform
- Chapter 36: Neural Networks That Learn
- Chapter 41: NP-Completeness
- Chapter 55: Iteration and Recursion
- Chapter 19: Computer Vision
- Chapter 61: Searching Strings
- Chapter 66: Church's Thesis
- Chapter 52: Text Compression
- Chapter 22: Minimum spanning tree
- Chapter 64: Logic Programming
- Chapter 60: Computer Viruses
- Show & Tell
- Elements of Computing Systems
- Archived pages