sikrob / slick-game-of-life Goto Github PK
View Code? Open in Web Editor NEWAn implementation of Conway's Game of Life in Java using the Slick2D and lwjgl (v2) libraries.
License: GNU General Public License v2.0
An implementation of Conway's Game of Life in Java using the Slick2D and lwjgl (v2) libraries.
License: GNU General Public License v2.0
On key releases, gardens can be updating. This seems like bad practice. We should be setting up our state to update but not resolving until the update step βΒ in this case, I'm thinking we should just have a flag that the garden can update and then just call garden.update() in the update loop step.
Or am I over thinking this?
At any rate, if we go this route, we may want to break out the auto funcitonality into a function that can get called immediately prior to actually updating the garden and have that function also just trip the "garden should update" flag. Then just update when we see that flag.
I'm thinking that this would technically be a good place to use an "updatable" interface or something to ensure readability in terms of what has or update flags and what gets updated in Update loop step.
Updatable would have, as a minimum, the "willUpdate" flag (or similar) and the update() method. Then called by update loop step with if (x.willUpdate) { x.update() } for all items.
This description also again highlights: Why bother if we aren't planning to add any more updatables?
It's better to build these gardens separately as walled and wrapped because, while much behavior is shared, they run different neighbor search methods based on a constant, "WALLED". It makes more sense to have separate possible instances of Garden that either Wall or Wrap the specimens so that the gardens aren't themselves carrying unreachable code. This will also aid readability.
From a higher level POV, since we can think of the different kinds of gardens as completely separate items, it makes sense to do so. Not sure if that is always going to be a good test, but it feels like a good indicator at least.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.