This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-11-04
Channels
- # announcements (13)
- # beginners (51)
- # boot (3)
- # calva (10)
- # cider (20)
- # clj-kondo (55)
- # cljs-dev (60)
- # clojure (99)
- # clojure-europe (6)
- # clojure-gamedev (9)
- # clojure-italy (19)
- # clojure-nl (7)
- # clojure-spec (20)
- # clojure-uk (42)
- # clojurescript (96)
- # clojurex (37)
- # clojutre (1)
- # cursive (37)
- # data-science (2)
- # datomic (15)
- # defnpodcast (9)
- # duct (7)
- # emacs (6)
- # events (9)
- # fulcro (124)
- # jackdaw (4)
- # jobs (4)
- # leiningen (9)
- # malli (7)
- # mount (3)
- # off-topic (109)
- # other-languages (8)
- # re-frame (39)
- # reagent (4)
- # reitit (6)
- # remote-jobs (2)
- # rewrite-clj (36)
- # ring (4)
- # shadow-cljs (16)
- # spacemacs (16)
- # tools-deps (91)
- # vim (8)
- # yada (2)
next question, friends! i have sequence of phases that happen "in order", which I've wired together normally. However, as this is a complex card game, various card effects can interrupt or change the order of those phases. For example, normally after the "approach server" phase, you "access cards" (sorry for terminology). However, a card effect says "the first time the "approach server" phase happens, move them back to the "approach ice" phase"
it's a state machine, but the available state machine tools that i've seen are a little more rigid than what I'm looking for
does anyone have experience rolling your own finite state machine for this purpose? I experimented with multimethods, but writing the dispatch felt awkward
should I just write a massive dispatch function that tries to take all of the exceptions into account?
ya know -- letfn
in conjunction with trampoline
is not a bad way to do it. Now -- I don't know how well that would work on the scale of a full game. But it works really well for simple state machines
if you happen to have a copy of "Joy of Clojure" they cover how to implement mutually recursive state machines with that technique
(there's a link to the code from "Joy of Clojure")
this is a great reason to finally buy a copy! thank you, i'll check that out