Question: Please complete in F - Sharp. Run program to make sure it works before submitting Complete the text - based adventure game ( three parts

Please complete in F-Sharp. Run program to make sure it works before submitting
Complete the text-based adventure game( three parts)
// Part 1: Data Model Design with Records and Discriminated Unions.
//--------- Model ---------
// TODO: implement all these records type:
let Details =
let Item =
let RoomId =
// discriminated unions
type Exit =
let Exits =
let Room =
let Player =
let World =
// Part 2: Initialize the game world
//--------- Initial World ---------
// TODO: creating the records based on the records type we created in the Model part by using the following information:
A key: Item type
Name: A shiny key
Description: This key looks like it could open a nearby door.
// Five rooms, put them inside a list:
Five rooms: Room type
Center room:
Id: center
Details:
Name: "A central room"
Description: "You are standing in a central room with exits in all directions. A single brazier lights the room."
Items: empty
Exits:
North = PassableExit ("You see a darkened passageway to the north.", RoomId "north1")
South = PassableExit ("You see door to the south. A waft of cold air hits your face.", RoomId "south1")
East = LockedExit ("You see a locked door to the east.", key, PassableExit ("You see an open door to the east.", RoomId "east1"))
West = PassableExit ("You see an intreresting room to the west.", RoomId "west1")
North1 room:
Id: north1
Details:
Name: "A dark room"
Description: "You are standing in a very dark room. You hear the faint sound of rats scurry along the floor."
Items: empty
Exits:
North = NoExit None
South = PassableExit ("You see an dimly lit room to the south.", RoomId "center")
East = NoExit None
West = NoExit None
South 1 room:
Id: sorth1
Details:
Name: "A cold room"
Description: "You are standing in room that feels very cold. Your breath instantly turns into a white puff."
Items: empty
Exits:
North = PassableExit ("You see an exit to the north. That room looks numch warmer.", RoomId "center")
South = NoExit None
East = NoExit None
West = NoExit None
West1 room:
Id: west1
Details:
Name: "A cozy room"
Description: "This room seems very cozy, as if someone had made a home here. Various personal belongings are strewn about."
Items: key
Exits:
North = NoExit None
South = NoExit None
East = PassableExit ("You see a doorway back to the lit room.", RoomId "center")
West = NoExit None
East1 room:
Id: east1
Details:
Name: "An open meadow"
Description: "You are in an open meadow. The sun is bright and it takes some time for your eyes to adjust."
Items: empty
Exits:
North = NoExit None
South = NoExit None
East = NoExit None
West = PassableExit ("You see stone doorway to the west. Why would you want to go back there?", RoomId "center")
A player: Player type
Details:
Name: "Luke"
Description: "Just your average adventurer."
Inventory: empty
Location: RoomId "center"
// gameWorld includes a map of rooms and a player(you need to convert the room list to room map)
gameWorld: World type
// Part 3: Defining a Logic Pipeline
//--------- Logic ---------
// TODO: according to the following function, design the proper functions.
// Hints: you may need at lest 10 more functions.
gameWorld
|> move south
|> describeCurrentRoom

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!