___ This is the code for the computer in Mercy, since a lot of interest has been shown in its mechanics. Note that these are code snippets and not a library file; hence the lack of exclamation points in this file. First, some simple grammar lines: ___ verb "log" * "in" -> Login * "into" noun -> Login; verb "login" * -> Login; [ LoginSub; "[That verb doesn't make sense in this context.]"; ]; verb "use" * noun -> Use; [ UseSub; "[Be more specific; how do you want to use that?]"; ]; ___ I decided to put in a line for 'use' since "I'm using the computer" is a pretty common way to say that you're operating a computer. It also puts in a nice message for Scott Adams graduates who want to 'use blade'. Then, some constants to keep it simple to remember what colors correspond to which numbers (in case you've got an interpreter that doesn't support colors, the computer screen itself is shown in white-on-red). ___ constant white 9; ! for screen effects constant black 2; constant red 3; ___ The following routines are the meat of the computer; you can look up the various assembly opcodes in the Z-Code Specs, which are highly- recommended reading. ___ ! WaitForKey waits for a key to be pressed. [ WaitForKey notNeeded; @read_char 1 notNeeded; rtrue; ]; ! LowerComment works in conjunction with PCscreen. It prints a line of text ! on the lower window. [ LowerComment string; @set_window 0; @set_colour black white; @erase_window 0; print "^"; print (string) string; WaitForKey(); @erase_window 0; @set_colour white red; @erase_window 1; @set_window 1; ]; ! PCscreen prints out the display that the player sees when using the ! computer. [ PCscreen; print "[MORE]"; WaitForKey(); @set_colour white red; @erase_window -1; @split_window 15; @set_window 1; print "Please login.^^"; print "account: "; WaitForKey(); print "p"; WaitForKey(); print "b"; WaitForKey(); print "a"; WaitForKey(); print "s"; WaitForKey(); print "h"; WaitForKey(); print "a"; WaitForKey(); print "m"; WaitForKey(); print "^password: "; WaitForKey(); print "*"; WaitForKey(); print "*"; WaitForKey(); print "*"; WaitForKey(); print "*"; WaitForKey(); print "*"; WaitForKey(); print "^^Hello, pbasham.^^"; print "NOTICE: We are running into some problems with the server. Currently,^ only mail access is working. We are working on it, though, and hope^ to have full net access restored soon.^"; lowerComment("Liars. There isn't any net to be restored to."); print "MAIL for pbasham@@64clinic33.mercy.org:^"; print "------------------------------------^"; print " Subject: Date: From:^"; print "[1] Official Inquiry 10/31 mrot@@64mercy.org^^"; print "[1...9] Read [C]ompose New [M]ove [D]elete [L]og out"; LowerComment(""); print "Date: 31 Oct 31 22:01:53 EST^"; print "From: mrot@@64mercy.org (Mort Roth)^"; print "Subject: Official Inquiry^"; print "To: pbasham@@64clinic33.mercy.org^"; print "____________________________________^"; print "^"; print "Dr. Basham:^"; print "^"; print "After an exhaustive audit of our antibiotic distribution channels,^"; print "which we of course note and appreciate you and your staff's complete^"; print "cooperation with, we noted several discrepancies in your antibiotic^"; print "distribution. We are in the process of filing several papers with^"; print "the City Board of Health regarding this matter, so we are not officially^"; print "indicting you or any of your staff at this time. However, an official^"; print "inquiry must be made at this time."; LowerComment("This could be bad. It's hard to say. And you miss Leslie."); print "Official inquiries are undertaken by a team of four auditors selected^"; print "by our Board of Directors. All have a terminal degree in their respective^"; print "programs and are experienced in auditing distribution channels.^"; print "^"; print "Inquiries usually take from two to six months, but our inquisitors^"; print "are eager to make the process as smooth as possible. Cooperation from^"; print "staff is necessary to make this as smooth as possible.^"; print "^"; print "We will also require you to go over, with your purser, the antibiotic^"; print "reception forms from the previous two years. We would especially like^"; print "you to pay special attention to the invoices, because we have found^"; print "that many of these problems are mere clerical errors.^"; print "^"; LowerComment("It's impossible. It'd never happen."); print "We are required by law to provide a detailed explanation of why the^"; print "official inquiry is being brought against you. During the period of^"; print "the last 3 months, our auditors have noticed 37 units of antibiotic^"; print "unaccounted for. Of the total of 5,000,000 units shipped to your^"; print "clinic, 4,821,399 were used, 123,000 units were deemed unsatisfactory^"; print "or contaminated, and 55,564 were listed as damaged or lost. 37, as^"; print "above, are unaccounted for.^^"; print "We hope that with your continued cooperation, we can resolve this^"; print "discrepancy as quickly as possible and with as little inconvenience as^"; print "possible. If you have any questions about the process, feel free to^"; print "send me to either me or my supervisor, ccaret@@64mercy.org.^"; print "^"; print "Mort Roth^"; LowerComment("You're in love with her. You start to laugh at yourself."); print "____________^"; print "Mercy is one of the few things we can offer to the world now.^"; print "-- J. Frederick Mendling^"; print "############^"; print "Opinions expressed within this email may or may not be the^"; print "opinions of my employer, Mercy Biosystems, or the government of^"; print "the city of Baltimore.^"; LowerComment("This is really too funny. You in love?"); print "MAIL for pbasham@@64clinic33.mercy.org:^"; print "------------------------------------^"; print " Subject: Date: From:^"; print "[1] Official Inquiry 10/31 mrot@@64mercy.org^^"; print "[1...9] Read [C]ompose New [M]ove [D]elete [L]og out"; LowerComment("You shouldn't be. You should forget her. She'll be gone.^^(You can't.)"); @set_colour white red; @erase_window -1; @split_window 15; @set_window 1; print "On for 23 minutes.^"; print "Goodbye, pbasham. Have a nice day."; WaitForKey(); @set_colour black white; @erase_window -1; @set_window 0; rfalse; ]; ___ Finally, the code for the computer object itself. Note that I decided that sitting down in the chair would indicate that you want to use the computer; perhaps an unfair assumption I'll change in release 2. ___ object -> pc "computer" with name "pc" "computer", initial "An abused computer sits in the corner. It's a crummy 386, but it came free with the place. Someone's left it on, which is sloppy.", description "The screen displays the login screen, which is bathed in red text graphics. Sometimes well enough should be left alone.", before [; take: "You don't want to; besides, it's bolted to the table."; switchOn: "It's already on."; switchOff: "What for? Really, it doesn't matter. It looks sloppy, but so what? Life just is too long. Why clean up after yourself? There isn't anything left. Just leave things as they are.^^And besides, you need to check that email Hegel was talking about, before...^^ Before..."; login: if (pc hasnt general) { print "You sit down in the chair, and turn your attention to the computer:^^"; give pc general; PCscreen(); "^You turn away from the computer. You'll deal with it later."; } else "You've already seen as much as you want to."; use: if (pc hasnt general) { print "You sit down in the chair, and turn your attention to the