. , . "".<br>
A notepad is a kind of thing. A notepad has an indexed text called memo. The memo of a notepad is usually "". Understand the command "read" as something new. Reading is an action applying to one thing and requiring light. Understand "read [something]" as reading. Check reading: if the noun is not a notepad: say "Nothing is written on [the noun]." instead; otherwise if the memo of the noun is "": say "At the moment, [the noun] is blank." instead. Carry out reading: if the memo of the noun is not "": say "On [the noun] you find the words '[memo of the noun].'"; otherwise: say "Nothing is written on [the noun]." Writing it on is an action applying to one topic and one thing and requiring light. Understand "write [text] on [something]" as writing it on. Check writing it on: if the second noun is not a notepad: say "You can't write anything on [the second noun]!" instead; otherwise if the second noun is the slate: if the player does not carry the chalk: say "You'd need some chalk to do that." instead. Carry out writing it on: let T be indexed text; let T be the topic understood; change the memo of the second noun to T; say "Writing '[T]' on [the second noun]." Erasing is an action applying to one thing and requiring light. Understand "erase [something]" as erasing. Check erasing: if the noun is not a notepad: say "There's nothing on [the noun] to erase." instead; otherwise if the memo of the noun is "": say "At the moment, nothing is written on [the noun]." Carry out erasing: change the memo of the noun to ""; say "You erase what was written on [the noun]." The Lab is a room. A piece of chalk is in the Lab. The player carries a fish. The description of the fish is "Scaly." The player carries a slate. The slate is a notepad. The description of the slate is "Black." Test me with "read fish / read slate / write E=mc2 on fish / write E=mc2 on slate / take chalk / write E=mc2 on slate / read slate / erase fish / erase slate / read slate".
A notepad is a kind of thing. A notepad has an indexed text called memo. The memo of a notepad is usually "". Understand the command "read" as something new. Reading is an action applying to one thing and requiring light. Understand "read [something]" as reading. Check reading: if the noun is not a notepad: say "Nothing is written on [the noun]." instead; otherwise if the memo of the noun is "": say "At the moment, [the noun] is blank." instead. Carry out reading: if the memo of the noun is not "": say "On [the noun] you find the words '[memo of the noun].'"; otherwise: say "Nothing is written on [the noun]." Writing it on is an action applying to one topic and one thing and requiring light. Understand "write [text] on [something]" as writing it on. Check writing it on: if the second noun is not a notepad: say "You can't write anything on [the second noun]!" instead; otherwise if the second noun is the slate: if the player does not carry the chalk: say "You'd need some chalk to do that." instead. Carry out writing it on: let T be indexed text; let T be the topic understood; change the memo of the second noun to T; say "Writing '[T]' on [the second noun]." Erasing is an action applying to one thing and requiring light. Understand "erase [something]" as erasing. Check erasing: if the noun is not a notepad: say "There's nothing on [the noun] to erase." instead; otherwise if the memo of the noun is "": say "At the moment, nothing is written on [the noun]." Carry out erasing: change the memo of the noun to ""; say "You erase what was written on [the noun]." The Lab is a room. A piece of chalk is in the Lab. The player carries a fish. The description of the fish is "Scaly." The player carries a slate. The slate is a notepad. The description of the slate is "Black." Test me with "read fish / read slate / write E=mc2 on fish / write E=mc2 on slate / take chalk / write E=mc2 on slate / read slate / erase fish / erase slate / read slate".
>test me (Testing.) >[1] read fish Nothing is written on the fish. >[2] read slate At the moment, the slate is blank. >[3] write e=mc2 on fish You can't write anything on the fish! >[4] write e=mc2 on slate You'd need some chalk to do that. >[5] take chalk Taken. >[6] write e=mc2 on slate Writing "e=mc2" on the slate. >[7] read slate On the slate you find the words "e=mc2." >[8] erase fish There's nothing on the fish to erase. >[9] erase slate You erase what was written on the slate. >[10] read slate At the moment, the slate is blank. >
>test me (Testing.) >[1] read fish Nothing is written on the fish. >[2] read slate At the moment, the slate is blank. >[3] write e=mc2 on fish You can't write anything on the fish! >[4] write e=mc2 on slate You'd need some chalk to do that. >[5] take chalk Taken. >[6] write e=mc2 on slate Writing "e=mc2" on the slate. >[7] read slate On the slate you find the words "e=mc2." >[8] erase fish There's nothing on the fish to erase. >[9] erase slate You erase what was written on the slate. >[10] read slate At the moment, the slate is blank. >
Source: https://habr.com/ru/post/70430/
All Articles