Re: Dials in Inform


24 Aug 1995 17:15:14 GMT

Christopher E. Forman <ceforma@rs6000.cmp.ilstu.edu> wrote:
> What's the simplest way to implement a dial that can be set to any
> number between 1 and 10 in Inform?

Object Dial "dial"
has static
with name "dial",
number 1,
description [;
print_ret "The dial is set to ", self.number, ".";
],
before [;
SetTo:
switch(special_number) {
1 to 10:
self.number = special_number;
print_ret "The dial is now set to ", self.number, ".";
default: "You can only set the dial to numbers between 1 \
and 10 inclusive.";
}
];

Extend "set" first * noun "to" number -> SetTo;

--
Gareth Rees