> > > Strategy for X:
> > >
> > > Initialize (in X's memory) a signal counter S = 0
> > >
> > > LOOP
> > >   IF NOT X's first time in room
> > >     AND state of switch B has changed from where X left it last THEN {
> > >       IF switch B changed from up to down THEN {yell "Shit!"; break;}
> > >         ELSE IF switch B changed from down to up THEN increment S
> > >   }
> > >
> > >   IF S >= 22 THEN declare "Everyone has visited" [much celebration];
> > >
> > >   TOGGLE switch B and remember its state;
> > > END_LOOP
> > >
> >
> >       I think that's how I read it the first time.
> > Look, when switch B is down, the warden takes one of the Rs
> > into the switch room 100 times in a row.  That should hold
> > until the switch is down again.  And X keeps toggling B,
> > so it should be down again pretty soon.
> 
> You lost me. If the warden takes an R in for the first time with switch
> B down, and then takes him back 100 times in a row, nothing will happen
> during those hundred trips, true. But eventually X will be taken in
> again, flip it up, then eventually R will see it up, then eventually X
> will flip it down, then eventually R will see it down again. It has to
> happen eventually.

Erik--
        I'm not sure what you mean by the loop, since you don't say
how it relates to the event 'X goes to the room'.  (Also, it doesn't
seem to actually be a loop since I see no sign that it gets executed
repeatedly.  Maybe you could rewrite this with 'on(roomvisit) do...',
or somesuch?  : )  )
        But I do read it as saying that X toggles switch B on every
visit.  So if the one R needs to visit the room again to catch up, 
the warden sends X to the room until switch B is down.  Then R can
go 100 times in a row, or whatever.
        (We are trying for a guaranteed solution.  A probabilistic 
one is not good enough.)

                                        ---David
_______________________________________________
http://www.mccmedia.com/mailman/listinfo/brin-l

Reply via email to