2020-06-25 16:11:04

Hello,
can someone explain me how does the adiacency list algorithms works? I wan tto build a map in the text game like MUD, and peopele advise to use this data structure.

If you want to contact me, do not use the forum PM. I respond once a year or two, when I need to write a PM myself. I apologize for the inconvenience.
Telegram: Nuno69a
E-Mail: nuno69a (at) gmail (dot) com

2020-06-25 18:06:08

I suppose you're badly misspelling adjacency list.  You don't want that.  All you need to do is make a dict called exits or something, and do:

room.exits["east"] = conservatory

or whatever.

This is kinda an adjacency list but usually by the time you're calling it an adjacency list you're talking about generic graph stuff which is massive overkill for anything you're doing.

My Blog
Twitter: @ajhicks1992

2020-06-25 22:47:46

Thank you Camlorn. Yeah, I never heard that word spoken, and I never use the English TTS, now I read your spelling and I understand. Thank you for your reply.
People on Reddit suggested using the adjacency list for a MUD-type map.

If you want to contact me, do not use the forum PM. I respond once a year or two, when I need to write a PM myself. I apologize for the inconvenience.
Telegram: Nuno69a
E-Mail: nuno69a (at) gmail (dot) com

2020-06-25 23:22:32

I mean, it's just a super fancy way to say dict of exits.  You don't usually hear the term outside mathematical papers.  If you were on a reddit with people who don't know what muds are, they might have thought you were asking about the sorts of pathfinding needed by modern sighted games, which will probably use adjacency lists for stuff.  But a mud is just a dict mapping names of the exit to the room it goes to, really, possibly with some flags like "is a door", "is a closed door" etc.

My Blog
Twitter: @ajhicks1992

2020-06-25 23:51:38

This is the map datatype on stunt and toaststunt. I've seen it used where a room contains a map of exits. Each value in the key value pair is either another map, or a list of strings and flags.

Facts with Tom MacDonald, Adam Calhoun, and Dax
End racism
End division
Become united

2020-06-26 10:32:01

Hi Camlorn,
I just have searched for "the best way to build a map for a text game", and that thing came up. I didn't ask this question myself.

If you want to contact me, do not use the forum PM. I respond once a year or two, when I need to write a PM myself. I apologize for the inconvenience.
Telegram: Nuno69a
E-Mail: nuno69a (at) gmail (dot) com