um/solution/foo.lisp

116 lines
6.1 KiB
Common Lisp

(success (command <command>))
(command (go <room>))
(room (name <string>)
(description <string>)
(items <list-of <item>>))
(item (name <string>)
(description <string>)
(adjectives )
(condition )
(piled_on ))
(success
(command
(look (room
(name "54th Street and Blackstone Avenue")
(description "You are standing at the corner of 54th Street and Blackstone Avenue. From here, you can go north, east, south, or west. ")
(items ((item (name "textbook")
(description "titled History of Modern Tabulation. The first chapter begins, By the year 1919FF, computers had become so small that they could be mounted on small auto-locomotive carts. These mobile tabulators (later known as \"robots\") were programmed to carry out everyday, menial tasks, leaving their human counterparts to live lives of idle luxury. For example, in the city of Chicago, mobile tabulators were programmed to carry out diverse jobs including law enforcement, bank robbery, investment banking, and waste management.
At one time, many humans demanded that their cybernetic neighbors be given the right to choose alternative occupations. Despite this call for workplace equality, most of the tabulators found that they were most content while performing their assigned roles. Those that took other jobs were often unmotivated and spend most of their time pondering useless ideas such as free will and consciousness.
The great tabulator-philosopher Turning stated that only by embracing its true purpose can a tabulator achieve something indistinguishable from happiness. According to observers, however, Turning was unfulfilled by his work as a philosopher and, soon after making this statement, returned to his work as a tool machinist.
The textbook rattles on in a similar vein for some five hundred additional pages")
(adjectives nil)
(condition (pristine nil))
(piled_on nil)))
::nil)))))
(success
(command
(show ((item (name "textbook")
(description "titled History of Modern Tabulation. The first chapter begins, By the year 1919FF, computers had become so small that they could be mounted on small auto-locomotive carts. These mobile tabulators (later known as \"robots\") were programmed to carry out everyday, menial tasks, leaving their human counterparts to live lives of idle luxury. For example, in the city of Chicago, mobile tabulators were programmed to carry out diverse jobs including law enforcement, bank robbery, investment banking, and waste management.
At one time, many humans demanded that their cybernetic neighbors be given the right to choose alternative occupations. Despite this call for workplace equality, most of the tabulators found that they were most content while performing their assigned roles. Those that took other jobs were often unmotivated and spend most of their time pondering useless ideas such as free will and consciousness.
The great tabulator-philosopher Turning stated that only by embracing its true purpose can a tabulator achieve something indistinguishable from happiness. According to observers, however, Turning was unfulfilled by his work as a philosopher and, soon after making this statement, returned to his work as a tool machinist.
The textbook rattles on in a similar vein for some five hundred additional pages")
(adjectives nil)
(condition (pristine nil))
(piled_on nil)))
::((item (name "manifesto")
(description redacted)
(adjectives nil)
(condition (pristine nil))
(piled_on nil)))
::((item (name "keypad")
(description "labeled \"use me\"")
(adjectives nil)
(condition (pristine nil))
(piled_on nil)))
::nil)))
(piled_on ((item (name "USB cable")
(description "compatible with all high-speed Universal Sand Bus 2.0 devices")
(adjectives nil)
(condition (broken
(condition (broken
(condition (broken
(condition (pristine nil))
(missing ((kind (name "T-9887-OFC")
(condition (broken
(condition (pristine nil))
(missing ((kind (name "X-6458-TIJ")
(condition (pristine nil))))
::nil)))))
::nil)))
(missing ((kind (name "F-6678-DOX")
(condition (pristine nil))))
::nil)))
(missing ((kind (name "N-4832-NUN")
(condition (pristine nil))))
::nil)))
(error (response <string>))
data Reply = Success Command
| Error Response
data Response = Response String
data Command = Go Room
| Look Room
| Examine Item
| Take Item
| Show [Item]
| ...
data Description = Str String
| Redacted
data Adjective = Adjective String
data Kind = Kind { kindName = String
, kindCondition = Condition }
data Missing = Missing [Kind]
data Condition = Pristine
| Broken Condition Missing
data Room = Room { roomName = String
, roomDescription = Description
, items = [Item] }
data Item = Item { itemName = String
, itemDescription = Description
, adjectives = [Adjective]
, itemCondition = Condition }