home *** CD-ROM | disk | FTP | other *** search
/ Seeker / Seeker.iso / files_w / w_puzzle.dir / 00085.ls < prev    next >
Encoding:
Text File  |  1994-12-05  |  1.6 KB  |  81 lines

  1. on clearcheck
  2.   global lpictblock, rpictblock
  3.   set l to 1
  4.   set l2 to 1
  5.   set r to 1
  6.   set r2 to 1
  7.   repeat with i = 11 to 30
  8.     if getAt(lpictblock, i - 10) <> i then
  9.       set l to 0
  10.     end if
  11.     if getAt(lpictblock, i - 10) <> (i + 20) then
  12.       set l2 to 0
  13.     end if
  14.     if getAt(rpictblock, i - 10) <> i then
  15.       set r to 0
  16.     end if
  17.     if getAt(rpictblock, i - 10) <> (i + 20) then
  18.       set r2 to 0
  19.     end if
  20.   end repeat
  21.   if ((l = 1) and (r2 = 1)) or ((l2 = 1) and (r = 1)) then
  22.     unLoad()
  23.     preLoad(53, 54)
  24.     repeat with i = 1 to 48
  25.       set the castNum of sprite i to 0
  26.       set the cursor of sprite i to 0
  27.       puppetSprite(i, 0)
  28.     end repeat
  29.     cursor(200)
  30.     go("clear")
  31.   else
  32.     go("center")
  33.   end if
  34. end
  35.  
  36. on leftcheck
  37.   global lpictblock
  38.   set p to 0
  39.   set q to 0
  40.   repeat with i = 1 to 20
  41.     if getAt(lpictblock, i) <> (i + 10) then
  42.       set p to 1
  43.     end if
  44.     if getAt(lpictblock, i) <> (i + 30) then
  45.       set q to 1
  46.     end if
  47.     if p and q then
  48.       exit repeat
  49.     end if
  50.   end repeat
  51.   repeat with i = 2 to 42
  52.     set the cursor of sprite i to [243, 244]
  53.   end repeat
  54.   if not p or not q then
  55.     play frame "leftbell"
  56.   end if
  57. end
  58.  
  59. on rightcheck
  60.   global rpictblock
  61.   set p to 0
  62.   set q to 0
  63.   repeat with i = 1 to 20
  64.     if getAt(rpictblock, i) <> (i + 10) then
  65.       set p to 1
  66.     end if
  67.     if getAt(rpictblock, i) <> (i + 30) then
  68.       set q to 1
  69.     end if
  70.     if p and q then
  71.       exit repeat
  72.     end if
  73.   end repeat
  74.   repeat with i = 2 to 42
  75.     set the cursor of sprite i to [243, 244]
  76.   end repeat
  77.   if not p or not q then
  78.     play frame "rightbell"
  79.   end if
  80. end
  81.