Skip to content

Instantly share code, notes, and snippets.

@ciwolsey
Created March 5, 2020 00:51
Show Gist options
  • Save ciwolsey/a9cb4ec0924e12e695bf5ed5bf944787 to your computer and use it in GitHub Desktop.
Save ciwolsey/a9cb4ec0924e12e695bf5ed5bf944787 to your computer and use it in GitHub Desktop.
type Description = {
text: string
}
type RoomObject = {
Description: Description
}
type Room = {
Description: Description
RoomObjects: RoomObject list
}
[<EntryPoint>]
let main argv =
let room = {
Description = { text = "A candle glimmers in the corner" }
RoomObjects = [
{ Description = { text = "A candle glimmers in the corner" } }
]
}
// print description of room
printfn "%s" room.Description
// print description of objects in room
room.RoomObjects
|> List.iter (fun RO -> printfn "%s" RO.Description.text)
0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment