Skip to content

Instantly share code, notes, and snippets.

@Hoekstraa
Created January 27, 2022 15:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Hoekstraa/29e5c06f20e206a7e96835594696e87b to your computer and use it in GitHub Desktop.
Save Hoekstraa/29e5c06f20e206a7e96835594696e87b to your computer and use it in GitHub Desktop.
Simple multiple choice game definition in json
{"start":["Welcome to this little game!",{"Thank you!":"goto"}],"goto":["Where would you like to go?",{"The airport":"airprt","The trainstation":"tsttn","A busstop nearby":"busstop"}],"airprt":["You arrive at the airport, what plane are you taking?",{"None, screw you!":"truelove","Germany":"de"}],"tsttn":["You arrive at the trainstation, in what direction are you gonna take a train?",{"Germany":"de","Nevermind, I'd rather go by plane.":"airprt"}],"busstop":["You go towards a busstop you see in the distance.",{"Continue walking":"busstop2","Fuck it, go back!":"goto"}],"truelove":["You find your true love, you go live with them in the bahamas.",{}],"busstop2":["You stand at the busstop for a while..",{"Wait..":"truelove","You walk away from your now past live":"truelove"}],"de":["You live the rest of your life, alone but satisfied, in Germany.",{}]}
@Hoekstraa
Copy link
Author

Dataset can be read as follows: hashmap of string -> array,
where string is a location and the array has: string and hashmap,
the array's string is a message to display on screen and the hashmap is a choice(string) -> the location to go to if chosen(string).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment