! hammaze.h - part of hamhall.

Global mazesize= MAXINT; ! -30765;
Constant xentrance -32753;
Constant UNTYPEABLE '..';
Constant STACKSIZE 500;  !700 OK for up to 2000x2000x2000
Array cube --> 6;
Global split;
Global pos;
Global dim;
Global mpos;

Global seed;

!Array z1 -> 85 85;
Array cubestack --> STACKSIZE;
!Array z2 -> 170 170;
Global mcubesp=0;
Global cubesp = cubestack;

[ PushCube;
  @copy_table cube cubesp 12;
  cubesp=cubesp+12;
  if (cubesp>=cubestack+STACKSIZE*2-10) {@output_stream 1; print "^Overflow!^^*The end*^"; @quit;}
if (cubesp>mcubesp) mcubesp=cubesp;  
  !print "(",cubesp,")^";
  ];

[ PopCube;
  cubesp=cubesp-12;
  @copy_table cubesp cube 12;
  !print "(",cubesp,")^";
  ];

[ PushVars;
  cubesp-->0=seed;
  cubesp-->1=split;
  cubesp-->2=pos;
  cubesp=cubesp+6;
  ];

[ PopVars;
  cubesp=cubesp-6;
  seed=cubesp-->0;
  split=cubesp-->1;
  pos=cubesp-->2;
  ];


Array posit --> MININT MININT MININT;  ! current player position
Array mposit --> MININT MININT MININT;  ! temporary mapping target position
Array features --> 0 0 0;

Global mapping;
Global exits;
Global nexits;

[ SetSeed cube  r;
  seed = 11 * cube-->0 - 2 * cube-->4;
  r = (cube-->2 | cube-->5) &~ (cube-->2 & cube -->5) + 3*cube-->1 - 5*cube-->3;
  seed = ((r | seed) & ~(seed & r)) + cube-->2;
  !@log_shift seed 1; ! rshift
  ];

Array seeda -> 0 0;

[ NextRand top;
  seed++;
  if (seed) {
!     seeda-->0=seed;
!     top=(seeda->0*75+(seeda->1*75)/256)/256; !0..74 overflow
    top= ((seed/256)*75+((seed%256)*75)/256)/256;  !this may assume unsigned div & mod!
!   seed= seed*75 -top + (seed<top);
     seed = seed*75-top;
     if (Unsigned__Compare(seed,top)~=-1) seed--;
    }
  else
    seed=65463;
!  seed--;
!  if (seed==-9743) seed=-9967;
  ];

[ RandRange floor ceiling   diff difft seedt;
  diff=ceiling-floor+1; !0..diff returned
  NextRand();
  !if (~~diff) return floor;
  if (diff>0 && diff < 4000) {
     return floor+(seed&$7FFF)%diff;
     }
  do {
     difft=diff; seedt=seed;
     while (difft>0) {
        @log_shift seedt $FFFF -> seedt;
        @log_shift difft 1 -> difft;
        }
     NextRand();
     } until (floor+seedt<=ceiling);
  return floor+seedt;
  ];

Array dirnames --> 'east' 'southeast' 'west' 'northwest'
                   'north' 'northeast' 'south' 'southwest'
                   'up' 'up' 'down' 'down'
                   'e//' 'se' 'w//' 'nw' 'n//' 'ne' 's//' 'sw' 'u//' 'u//' 'd//' 'd//'
                   ;
!-----------------------------------------
! Calculation section
!-----------------------------------------

[FullCube t;
  cubesp=cubestack;
  for (t=0: t<=4: t=t+2) {
     cube-->t=MININT;
     cube-->(t+1)=mazesize;
     }
  ];

[ CubeSize  i res d;
  res=1;
  for (: i<6: i=i+2) {
     d=cube-->(i+1) - cube-->i+1;
     if (d<1 || 20000/res/d < 1) return MAXINT; ! some large number
     res=res*d;
     }
  return res;
  ];

![ HalfWidth n c a b;
!  !overcome JZIP unsigned division
!  c=cube-->(n+1);
!  @log_shift c $FFFF -> b;
!  c=cube-->(n);
!  @log_shift c $FFFF -> a;
!  return b-a;
!  !(cube-->(k+1))/2 - (cube-->k)/2
!  ];

!-------------------------
! SplitCube
!-------------------------


Global percentsign;
[ PercentDone div i t;
  div=(mazesize/33)+992;
  if (~~div) return;
  for (i=0: i<=2: i++) {
     t=t+( (posit-->i / div) -MININT/div);
     }
  print t/10,t%10;
  percentsign=~~percentsign;
  if (percentsign) print "%"; else print "/";
print mcubesp-cubestack;
  ];

[ SplitCube tx ty tz   k ; !split pos dim mpos; ! s0 s1 s2 s3 s4 s5;
!print "#",tx," ",ty," ",tz,"#";
!  jump NS2;
!  print "[";
!  .NS2;
  .NextSplit;
  if (mapping==1) return;
!if (z1->1~=85) print "S Underflow^^";
!if (z2->0~=170) print "S Overflow^^";
  
  if (mapping && tx==posit-->0 && ty==posit-->1 && tz==posit-->2) return;

  if (mapping)
     PushCube();

  SetSeed(cube);  NextRand();

  !which way will we slice?
  pos=0;
  for (k=0: k<=4: k=k+2) {
     pos=pos+ ((cube-->(k+1))/2 - (cube-->k)/2) /3;
!     pos=pos+ HalfWidth(k) /3;
     }
#ifdef DEBU;
print "(*", pos," ", seed," ";    
#endif;
  dim=RandRange(1,pos);
!print "C"; @read_char 1 dim;
  if (pos>1)
     for (k=0: k<=4: k=k+2) {
        dim=dim - ((cube-->(k+1))/2 - (cube-->k)/2) /3;
        if (dim<=0) break;
        }
  if (k>4)
     do k=RandRange(0,2)*2;
        until (cube-->k < cube--> (k+1));
#ifdef DEBU;
print ")*^";     
#endif;

  !and where?
  split=RandRange(cube-->k +1, cube--> (k+1)); ! split is between cells split & split-1
  pos=posit-->(k/2);
  if (pos<split)
    cube-->(k+1) = split-1;
  else
    cube-->k = split;

#ifdef DEBU;
print k;
print "[";
for (dim=0: dim<=5: dim++) print cube-->dim,", ";
print "]",cubesp-cubestack,"^";
#endif;

  if (mapping) { ! where have we got to get to?
     mposit-->0=tx; mposit-->1=ty; mposit-->2=tz;
     mpos=mposit-->(k/2);
     if ((pos<split) == (mpos<split)) {
        cubesp=cubesp-12;
!print "/";
        jump NextSplit;
        }
     }
  else {
     if (pos ~= split or split-1) return; ! not near the boundary
     for (dim=0: dim<3: dim++)
       if (dim ~= k/2) {
         if (posit-->dim ~= RandRange(cube-->(dim*2), cube--> (dim*2+1)))
            return;
         };
     };
!if (mapping) print "*", pos," ",mpos," ", split,"*";     
  if (mapping ) { ! need to cross barrier, so get there first
     ! if ((pos<split) ~= (mpos<split))
        for (dim=0: dim<3: dim++) ! mposit holds the diversionary target
          if (dim ~= k/2)
            mposit-->dim = RandRange(cube-->(dim*2), cube--> (dim*2+1));
          else
            mposit-->dim=split-(pos<split);
     PushVars();
     SplitCube(mposit-->0,mposit-->1,mposit-->2);
     PopVars();
     ! the only more stack-efficient way of doing the above restore involves a FullCube & iterating until split & k are the same
     }

  ! we are near a passage
  dim=k+(pos>=split); ! 0=east, 1= west, 2=north, 3=south, 4=up, 5=down
  House.&spec-->(3*dim)= dirnames-->(12*(mapping<0)+dim*2+RandRange(0,17)/16);

  if (mapping ~=0 or 1 ) {
     !print the direction
     print (address) House.&spec-->(3*dim); if (mapping~=2) print ", ";
     if (mapping<0 && mapping%12 == 0) {
        print "^"; 
        if (mapping%600 == 0) {
           @output_stream 1; !@buffer_mode 0;
           @set_window 1; @set_cursor 1 25; 
           !style reverse;
           !style roman;
           PercentDone();
           @set_window 0;
           
           !print ".";
           @buffer_mode 1;

           @output_stream -1;
   
           !@output_stream 1; 
           mapping=-1; !indefinitely
           }
        } 
     mapping--;

     !move marker;
     posit-->(k/2)=split-(pos>=split);
     PopCube();   
!     SplitCube(tx,ty,tz); ! continue on (any) journey - could jump back to save
!print ">";
     jump NextSplit;
    } ! if mapping
  ];


!-------------------------
! MoveMaze
!-------------------------

[ MoveMaze dx dy dz r t size;   ! using comp
  move player to Entrance; ! out of the way for the time being
  r=child(House);
  while (r && r~=House) {
    t=parent(r);
    if (r provides hparent) {
       r.x=posit-->0;
       r.y=posit-->1;
       r.z=posit-->2;
       r.hparent=t;
       }
    move r to RestOfHouse;
    if (child(r) && child(r) has listed or portable)
       r=child(r);
    else {
       if (t==RestOfHouse) t=House;
       if(child(t)) r=child(t);
       else r=t;
       }
    }
  
  if (posit-->1 == MININT && dy==-1) ! && posit-->2 == MININT && posit-->0==xentrance or MININT)
     {return;}
  if (posit-->2 == mazesize && dz==1) { ! && posit-->1 == mazesize && posit-->0==mazesize
     move player to Roof; "You climb the steps and at last emerge onto the...^";
     }
  posit-->0=posit-->0+dx; posit-->1=posit-->1+dy; posit-->2=posit-->2+dz;
  if (dx || dy || dz) location=0; ! relook
  move player to House; 

  for (r=0: r<=5: r++)
     House.&spec-->(r*3) = UNTYPEABLE; ! untypeable
  if (posit-->2 == MININT && posit-->1 == MININT  && posit-->0==xentrance or MININT)
     {House.&spec-->9 = 'south';}
  if (posit-->2 == mazesize && posit-->1 == mazesize && posit-->0==mazesize)
      House.&spec-->12='up';

  FullCube();
  while ((size=CubeSize())>1) {
     SplitCube();
     };

  exits=0; nexits=0;
  for (t=0: t<=5: t++) {
     exits=exits*2;
     if (House.&spec-->(3*t)~=UNTYPEABLE) {
       exits++; nexits++;
       }
     }

  !now make up some semirandoms
!print Seed,"!";
  for (r=0: r<=5: r++) {
    t=(r+2)%6; 
    features->t = ((posit->r | posit->t) & ~ (posit->r & posit->t)) + seed !; ! NextRand();
     - (posit->1 + posit->3 + posit->5 - xentrance);
!print features->t," ";
    }
!print ":";
  for (r=0: r<=9: r++) {
    t=(r+3)%6;
    size=features->t + features ->(r%6);  ! Using RandRange is probably slightly degenerate, so not unique.
    features->t = (size + (size>$FF)) & $FF;
!print features->t," ";
    }
  House.SetVars();
  
  !dropped objects
  r=child(RestOfHouse);
  while (r) {
    t=sibling(r); ! everything portable should provide hparent &xyz
          !if (~~ r provides hparent) move r to House; else
    if (r provides hparent && r.x==posit-->0 && 
          r.y==posit-->1 && r.z==posit-->2) 
       move r to r.hparent;
    r=t;
    }

  if (Ant.located>0) Ant.located--;
  if (features->0 & 6 == 0 && ~~Ant.located) {
     move Ant to House;} ! if not already there of course.

  ];
  
!-----------------------------------------
! Actual descriptions
!-----------------------------------------

Object RestOfHouse;  ! simple container object, never visited

Array periods --> "Gothic" "Georgian" "modern" "Edwardian" "Queen Anne"
"classical" "Victorian" "Elizabethan" "Hanoverian" "Tudor" "medieval"
"eighteenth-century" "17th-century" "rococo" "baroque" "18th-century";

Array tableadjs --> "rectangular " "square " "squat " "oblong " "large square " "irregularly-shaped "
"low " "imposing " "elegant " "expensive-looking " "antique " "smallish "
"rarely-used " "round " "modest " "three-legged ";

Array tableposs -->
"pushed against the wall" "in the centre of the room" "in one corner"
"next to the door" "here" "in an unobtrusive corner" "placed
conveniently" "tastefully positioned";

Array tableadj2s -->
"rosewood " "marquetry " "mahogany " "mother-of-pearl " "oak " "wooden "
"ornamented " "";

Array tablenouns -->
"table" "occasional table" "writing-desk" "pedestal"
"escritoire" "cabinet" "dresser" "rack";  !escritoire plinth cabinet dresser

Array roomadjs -->
"rectangular" "square" "high-ceilinged" "oblong" "sombre"
"oddly-shaped" "vacant" "imposing" "elegant" "opulent" "circular"
"smallish" "rarely-used" "round" "modest" "musty";

Array decors -->
"still life" "portrait" "fresco" "mural" "pastel" "etching" "seascape" "landscape";

!"covered with drapes" "painted bright yellow" plain

Array firstexits -->
"a door" "a passage" "a connecting corridor" "double doors"
"steps" "narrow stairs" "a wide staircase" "stone steps";

Array exitn -> 1 1 1 0 0 0 1 0;

Array sent3s -->
     "a grandfather clock" "ticks reassuringly"
     "a long-case clock" "stands silently"
     "a large persian rug" "covers the floor"
     "lush carpet" "is underfoot"
     "you smell" "history"
     "the room reeks of" "ancient scents"
     "light comes from" "a chandelier"
     "the room is lit with" "candelabra"
     "chairs are" "scattered about"
     "furniture is" "placed randomly"
     "a mirror hangs above"  "an empty fireplace"
     "a large mantel overhangs"  "a hearth"
     "animal-head trophies" "stare from the wall"
     "stuffed game" "are proudly displayed"
     "the walls are"  "obscured by drapes or hangings"
     "each wall is"  "covered with flocked wallpaper";

Object House "House"
with
name 'door' 'stairs' 'steps',
spec
'east'  TURN [; MoveMaze(1,0,0);]
'west'  TURN [; MoveMaze(-1,0,0);]
'north' TURN [; MoveMaze(0,1,0);]
'south' TURN [; MoveMaze(0,-1,0);]
'up'    TURN [; MoveMaze(0,0,1);]
'down'  TURN [; MoveMaze(0,0,-1);]

'follow' 'ant' TURN [;
   if (ant.located>7) {
      posit-->0=ant.x; posit-->1=ant.y; posit-->2=ant.z;
      MoveMaze();
      !MoveMaze(ant.x-posit-->0, ant.y-posit-->1, ant.z-posit-->2);
      location=0; !ensure 
      }
   else "You are uncertain about both its position and momentum.";
   ]

'listen' TURN "Just a clock ticking.  The house is deserted of visitors, both human and otherworldly.",

period 0,
tableadj 0,
tablepos 0,
tableadj2 0,
tablenoun 0,
roomadj 0,
decor 0,

SetVars [;
   House.period=periods --> (features->1 &15);
   House.tableadj = tableadjs-->(features->1 /16);
   House.tablepos = tableposs --> (features->2 &7);
   House.tableadj2 = tableadj2s --> ((features->2/8) &7 );
   House.tablenoun = tablenouns --> (features->3 &7);
   House.roomadj = roomadjs --> (features->3 /16);
   House.decor = decors --> (features->4 &7); 

  !move (scenery) objects in accordingly
  move Table to House; move Paintings to House; move Walls to House;
  switch (features->5 & 3) {
     1: move Bust to Table; if (Remote hasnt handled) move Remote to Table;
     2: move Photo to Table;
     3: move Gramophone to Table; if (Gramophone has solved) move Slider to House; 
     }

  ],

tablephrase [n;
      if (n) nstring(House.tableadj); else print (string) House.tableadj;
      print (string) House.tableadj2; return House.tablenoun;],

shortname [n;
   n=features->3 & 8;
!  m=features-->3 &16;
!  if
  switch ( (features->0/2) &3) {
     1: print (capitalize) House.roomadj, " ";
     2: print (capitalize) House.period, " ";
     3: print (capitalize) House.decor, " ";
     };
  if (exits == $$110000 or $$001100) {
     if (n) print "Corridor"; else print "Passage"; }
  else if (exits == 32 or 16 or 8 or 4 or 1) {if (n) print "Study"; else {move Bed to location; print "Bedroom";}}
  else if (exits & 1 && exits & $$111100) {if (n) print "Landing"; else print "Upper Level";}
  else if (exits == $$11) {if (n) print "Half Landing"; else print "Stairwell"; }
  else if (exits == 2) {if (n) print "Cellar Room"; else print "Boudoir";}
  else if (nexits ==2 && (exits &3==0) && (features-->5 &1 ==0)) {if (n) print "L-Shaped Passage"; else print "Corridor Bend";}
!  else if (exits & 3 = $01 & nexits>1) {if (n) print "Lower Floor"; else print "Foot of Stairs";}
  else {if (n) print "Hall"; else print "Drawing Room";}
  rtrue;
  ],

dotable [;
  switch (features->0 /64) {
     0: print "A", (string) House.tablephrase(1), " is ",(string) House.tablepos;
     1: print (capitalize) House.tablepos, " is a", (string) House.tablephrase(1);
     2: print "You can see a", (string) House.tablephrase(1), " ", (string) House.tablepos;
     3: print "A", (string) House.tablephrase(1), " can be seen ", (string) House.tablepos;
     }
],

dodirs [i t d e e2;
  t=0;
  for (i=0: i<=5: i++) {
     d=House.&spec-->(3*((i+features->1 +4)%6));
     if (d~=UNTYPEABLE) {
        t++;
        if (t==2) {
              if (features->2 & 128) {
                 if (nexits>2) print ".  Other exits lead ";
                 else print ".  Another exit leads ";
                 }
              else print ", and you can also go ";
              }
        if (t==1) {
           e = (4*(d=='up' or 'down') + (features->5 /4)&3 );
           e2=exitn -> e;
           e=firstexits --> e;
           if (nexits==1) {
             print "The only ";
             if (features->2 & 128) print "exit";
             else print "way out";
             print " is "; 
             print (string) e, " that ";}
           else print (capitalize) e, " ";
           if (features->2 & 64) {
              print "lead"; if (e2) print "s";
              }
           else {
              print "go"; if (e2) print "es";
              }
           print " ";
           }
        if (t>2)
          if (t==nexits) print " and ";
            else
               print ", ";
        print (address) d;
        }
     }
],

sent2 [caps;
  switch ((features->4/8)&1) {
     0: if (caps) print "T"; else print "t";
        print "he walls are hung with ",(string) House.decor,"s";
     1: if (caps) print (capitalize) House.decor;
        else print (string) House.decor;
        print "s decorate the walls";
     };
  ],

sent3 [caps  n n2 f;
  n=(features->4)/16;
  f=(features->5 /16)&1;
  n2=(n|f)&~(n&f); n=n*2; n2=n2*2+1;
  !PrintShortName (sent3o-->(n/2));
  move (sent3o-->(n/4)) to House;

  if (caps) print (capitalize) sent3s-->n; else print (string) sent3s-->n;
  print " ",(string) sent3s-->n2;
  ],

description [;
  switch ( (features->0 /8) &7 ) {
     0: print "A",(nstring) House.roomadj, " room decorated in a",
          (nstring) House.period, " style";
     1: print "This ",(string) House.roomadj, " room is ",
          (string) House.period, " in appearance";
     2: print "This part of the house is ",(string) House.period, " and ",
          (string) House.roomadj;
     3: print "You are in a", (nstring) House.roomadj, ", ",
          (string) House.period, "-themed room";
     4: print "A",(nstring) House.roomadj, " chamber, which is decorated in a",
          (nstring) House.period, " style";
     5: print "This ",(string) House.roomadj, " room is apparently ",
          (string) House.period;
     6: print "This section of the home seems to be ",(string) House.period, " and ",
          (string) House.roomadj;
     7: print "You stand in a", (nstring) House.roomadj, ", and supposedly ",
          (string) House.period, ", room";
     }
  print ".  "; ! second sentence

  ! and/while

  if (features->5 & 128) House.sent2(1); else House.sent3(1);
  if (features->5 &64) print " and "; else print ", while ";
  if (features->5 & 128) House.sent3(); else House.sent2();
  print ".  "; ! third sentence

  if (features->5 & 32) House.dotable(); else House.dodirs();
  print ".  "; ! fourth sentence
  if (features->0 &1) print "^^";
  if (features->5 & 32==0) House.dotable(); else House.dodirs();
!  if (nexits==1) print "The only exit is "; else print "Exits lead ";
  print ".^";
  if (Ant in House) {
    if (ant.located>=10) {new_line; ConsiderSub(); ant.located=3;}
    else print "^You notice a tiny ant crawling along the floor.^";
    }
];

Object Bed "bed"
with name 'bed',
spec 'look' 'under' THIS TURN LookUnderSub,
has surface;

Object Clock "clock"
with name 'long' 'long-case' 'grandfather' 'clock';

Object Carpet "carpet"
with name 'carpet' 'persian' 'rug';

Object Smell
with name 'smell',
description SmellySub,
spec 'smell' SmellySub;

[SmellySub; "Perfumed, but slightly mildewy.";];

Object Candle "light"
with name 'candelabra' 'chandelier' 'light';

Object Chairs "chair"
with name 'chair' 'furniture'
has surface;

Object Hearth "mantelpiece and hearth"
with name 'hearth' 'fire' 'fireplace' 'mirror' 'mantel' 'mantelpiece'
has surface;

Object Trophy "stuffed animal"
with name 'trophy' 'head' 'case';

Object Walls "wall"
with name 'wall' 'walls' 'paper' 'hangings';

Array sent3o --> Clock Carpet Smell Candle Chairs Hearth Trophy Walls; ! must come after object defs

Object Paintings "paintings"
with name 'portrait' 'picture' 'painting' 'fresco' 'landscape' 'seascapes' 'portraits' 'etchings' 'mural' 'pastel',
description "Assorted pictures adorn the walls including battle scenes, and the
  occasional portrait of the 1st Lady Stoattrouser.";

Object Table "table"
with name 'pedestal' 'table' 'writing' 'writing-desk' 'desk' 'round' 'rosewood' 'oak' 'drawer'
'occasional' 'escritoire' 'cabinet' 'dresser' 'marquetry' 'rack', ! plinth?
description [; print "You see nothing special about the ", (string) House.tablephrase()," in itself.^";],
shortname [; print (string) House.Tablenoun; rtrue;],
spec 'look' 'under' THIS TURN LookUnderSub
'look' 'behind' THIS TURN LookUnderSub
'open' THIS TURN "There's nothing important inside."
has surface;

[ LookUnderSub;
 if (file has handled) "Nothing but dust.";
 move file to location; itval=file;
 "Poking around, you find a box file of confidential records secreted under the table.";
 ];

Object Gramophone "old-fashioned gramophone"
with name 'old' 'old-fashioned' 'wind-up' 'gram' 'gramophone' 'phonograph' 'brass' 'horn' 'record' 'turntable'
   'player' 'controls' 'case' 'pathfinder' 'pioneer' 'revolver' 'handle',
activated Slider,
autonomous [; if (random(16)==1 && Gramophone hasnt solved)
      {if (Remote in Desk) "You suddenly remember seeing something lying on your desk.^";
       if (Remote notin Player) "Where did you put that remote control?^";
      "Something about this room makes you tense and look around again.^";
      }],
description "It appears to be an antique wind-up record player with a brass horn.  It says ~Pathfinder Control Systems~ on the case.",
properloc [;give Gramophone solved;],
spec 'wind' 'up' EQUIV 'play' THIS TURN "The handle doesn't seem to be functional.  Could the machine be a fake?"
has listed;

Object Bust "marble bust of the first Lord Stoattrouser"
with name 'marble' 'bust',
description "It looks like a this rendering rather flatters the old man.",
has listed;

Object Photo "photograph of Lady Stoattrouser"
with name 'lady' 'photo' 'photograph',
spec 'take' THIS TURN [; if (player has solved) "Why would you want such a hideous thing?";
                        "You daren't move their Lord and ladyship's personal things.";],
has listed;

Object Slider "slider control"
with name 'plastic' 'grey' 'slider' 'control' 'settings' 'dial',
description [; print "As far as it looks like anything real, the slider control seems to be made out of
             grey plastic.  It shimmers slightly, and you can't work out if it's attached to the wall
             or floating in mid-air.  Settings beneath it seem to range from 4 to 65535; it is currently set to ";
             if (mazesize>=0) "the high end of the dial.";
             print_ret mazesize-MININT,".";],
spec 'move' THIS 'to' TURN [i size;
  for (i=2: i<2+buffer->1: i++)
     if (buffer->i >='0' && buffer->i <='9')
        size=size*10+buffer->i-'0';
  if (size>-1 && size<4) "Check the slider for valid settings.";
  size=size+MININT;
  if (size==mazesize) {
!     if (size-MININT==2003) {posit-->0=posit-->0+1044; posit-->1=posit-->1+1101;  
!        posit-->2=posit-->2+621; MoveMaze(); LookSub(); }
     "Nothing happens.";
     }
  mazesize=size;
  for (i=0: i<=2: i++) if (posit-->i > mazesize) posit-->i = mazesize;
  if (ant.located) ant.located=3; ! So we don't need to hunt too far
  MoveMaze();
  "A strange grumbling vibration comes through the walls and floor and you get the impression
  that the entire house is shifting.";
  ],
deactivated Gramophone,
has listed;



