// Text Adventure -- world data (finished). // // A room has a name, a description, exits and items, and each of them is a // different type. One map has one value type, so each kind of information has // its own map, and all four use the room id as the key. // // Exits maps a direction to a room id. Items is a slice of strings. package world const StartID = 1 var Names = map[int]string{ 1: "Forest Path", 2: "Clearing", 3: "Cave Entrance", 4: "Treasure Chamber", } var Descriptions = map[int]string{ 1: "You are on a moss covered forest path. Birdsong drifts on the air.", 2: "A small clearing of wildflowers.", 3: "A cool, damp cave mouth opens below you.", 4: "Crystals glitter on the walls. In the centre stands a stone pedestal.", } var Exits = map[int]map[string]int{ 1: {"north": 2}, 2: {"south": 1, "east": 3}, 3: {"west": 2, "down": 4}, 4: {"up": 3}, } var Items = map[int][]string{ 1: {}, 2: {"torch"}, 3: {"rope"}, 4: {"gold coin"}, }