3 ms·
As an alternative design, I'd have gone with a data structure more like: #:minesweeper{:size [w h] :bombs #{[x y] ...}
by weavejester 8y ago
As an alternative design, I'd have gone with a data structure more like:
#:minesweeper{:size [w h]
:bombs #{[x y] ...}
:flags #{[x y] ...}
:guesses ([x y] ...)}
- sneakypeet 8y agoYes that is pretty smart. One of my game design friends mentioned the same thing after I showed him the code. I sometimes feel I am still living in that oo mindset
- pgt 8y agoI wrote Snake in 100 lines of ClojureScript for a talk at UCT a few years ago and used that shape of data structure: http://theronic.github.io/cljs-snake/ http://theronic.github.io/cljs-snake/ For anything more complex, I immediately reach for DataScript as a client-side Datalog DB.
- sneakypeet 8y agoHa. I made a similar thing trying out p5 for the first time. https://sneakypeet.github.io/data-snake/ https://sneakypeet.github.io/data-snake/