lfeutre / lmud

An Erlang and LFE MUD/MUSH Server.
Other
23 stars 9 forks source link

Create lobby "game" #63

Open oubiwann opened 2 years ago

oubiwann commented 2 years ago

Depends on:

Tasks:

oubiwann commented 2 years ago

I created this in Twine: lobby-game.json.txt

I've used Twine before, and have enjoyed it for creating the tiny fragments of IF I've worked on before. Would be interesting to parse and convert to a format usable by lmud ...

oubiwann commented 2 years ago

Example basic parsing:

lfe> (set `#(ok ,json-bytes) (file:read_file "priv/twine/lobby-game.json"))
lfe> (set data (jsx:decode json-bytes '()))
lfe> (list-comp ((<- p (mref data #"passages"))) (mref p #"name"))
(#"Lobby"
 #"Create Character"
 #"Join Game"
 #"Delete Character"
 #"Manage Account"
 #"Delete Account")
oubiwann commented 2 years ago

New way of doing the above:

(clj:-> "priv/twine/lobby-game.json" 
        (lmud-twine:read) 
        (lmud-twine:passages))

which gives:

(#"Lobby"
 #"Create Character"
 #"Join Game"
 #"Delete Character"
 #"Manage Account"
 #"Delete Account")