home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / amiga / comms / bbs / gitaris.lzh / gitaris.trans < prev    next >
Text File  |  1992-02-17  |  31KB  |  1,204 lines

  1. /*****************************************************************************/
  2. /*                                                                           */
  3. /* GiTAris.trans                  Copyright '91, '92 by Georg 'Gio' Magschok */
  4. /*                                                                           */
  5. /*                                Tetris (tm) - clone for TransAmiga BBS 1.1 */
  6. /*                                                                           */
  7. /* Copyright:    This script is public domain                                */
  8. /*               you can do anything you want with this program EXCEPT:      */
  9. /*               - distributing modified versions under its original name    */
  10. /*               - selling it for your profit                                */
  11. /*                                                                           */
  12. /* The author takes no responsibility for anything...                        */
  13. /*                                                                           */
  14. /* Installation: - put this one into bbs:rexx/                               */
  15. /*               - be sure to have gitaris in bbs:text/                      */
  16. /*                     "           gitarismenu in bbs:text/                  */
  17. /*               - add the following line to your bbs:configs/extra.rx:
  18.  
  19. G GiTAris                050 -------- GiTAris.trans
  20.                                                                              */
  21. /*               -       ^^^^^^^^^^^^ change these to fit your needs         */
  22. /*                                                                           */
  23. /* Requiries:    - TransAmiga 1.1 or later                                   */
  24. /*               - *accelerated* Amiga (on 68000 it's quite slow :-)         */
  25. /*                 (I'm using it on 14MHz 68020 - that's sufficient!)        */
  26. /*                                                                           */
  27. /* Thanks to:    - all my users for testing & playing                        */
  28. /*                   especially Lorenz Stoessel who Tetris'ed like a fool... */
  29. /*                   especially Christian Soerensen                          */
  30. /*               - Tobias 'Top' Walter for his ARexx-advice                  */
  31. /* History:                                                                  */
  32. /*                                                                           */
  33. /* 30.08.91  Idea when programming Basic (ugly) 9.0.1 on HP 260              */
  34. /* 31.08.91  began programming                                               */
  35. /* 03.09.91  speedup, important functions implemented                        */
  36. /* 04.09.91  collisions are now detected, all normpieces implemented         */
  37. /* 05.09.91  added ANSI graphics, bugs removed                               */
  38. /*           hours of testing by Lorenz Stoessel (Thanks!)                   */
  39. /*           Highscores are being saved now                                  */
  40. /*           'Next' function and much more implemented                       */
  41. /* 06.09.91  the first online-day for all users. some bugfixes               */
  42. /*           each exact 1000 points, one line is inserted at the bottom      */
  43. /* 12.09.91  added Settingsmenu, Bugfixes                                    */
  44. /*                                                                           */
  45. /* 12.09.91  FIRST RELEASE-VERSION                                           */
  46. /*                                                                           */
  47. /* 13.09.91  fixed a bug when key pressed too early, better errorhandling    */
  48. /* 24.09.91  adaption to ABBEREXX 1.0                                        */
  49. /* 23.01.92  fixed a bug in random-number generation                         */
  50. /* 17.02.92  optical cleanup in the menu                                     */
  51. /*                                                                           */
  52. /* Future:                                                                   */
  53. /*           except for some bugfixes, I'll do nothing more on this script.  */
  54. /*                                                                           */
  55. /* call Gio's home BBS +49-7202-2386 9600 8n1 24h 1500+files, TransAmiga 1.1 */
  56. /*****************************************************************************/
  57.  
  58. options results
  59.  
  60. rc=0
  61. sig=0
  62. signal on error
  63. signal on ioerr
  64. signal on syntax
  65.  
  66. /* some globals you may need to adjust. */
  67.  
  68. timeback  = 1  /* set 1 here, if the 1st place score shall get his time back */
  69. liftit    = 300        /* if score mod liftit=0 then insert a line!          */
  70. sysopname = 'GEORG MAGSCHOK'         /* to be avoided in the highscorelist   */
  71. topfile   = 'bbs:bulletins/GiTAris.top'   /* where to put the topten-list    */
  72. screen    = 'bbs:text/GiTAris'           /* the background for tetris        */
  73. helpfile  = 'bbs:text/GiTAris.help'     /* help for the game                 */
  74.  
  75. /* _main --- master to call the slaves                                       */
  76.  
  77. main:
  78.  call settingsmenu
  79.  call init
  80.  call clear
  81.  call advance
  82.  do forever
  83.   maygetchar
  84.   select
  85.    when result = '6' then call rechts     /* you may of course change these  */
  86.    when result = '4' then call links      /* keys if you don't like them,    */
  87.    when result = '2' then call down       /* but don't forget to edit the    */
  88.    when result = '1' then call togglenext /* bbs:text/GiTAris.help file      */
  89.    when result = '5' then call turn       /* if you do change them.          */
  90.    when result = '8' then call turnback
  91.    when result = 'q' then do
  92.     call settingsmenu
  93.     call init
  94.     call clear
  95.    end
  96.    when result = 'p' then call pause
  97.    when result = '9b'x then do
  98.      maygetchar
  99.      if result = 'A' then
  100.       call turn
  101.      else
  102.       if result = 'B' then
  103.        call down
  104.       else
  105.        if result = 'C' then
  106.         call rechts
  107.        else
  108.         if result = 'D' then
  109.          call links
  110.         else do
  111.          call advance
  112.          getcarrier
  113.          if result~='TRUE' then call ende
  114.         end
  115.     end
  116.    when result = '1b'x then do
  117.     maygetchar
  118.     if result = '[' then do
  119.      maygetchar
  120.      if result = 'A' then
  121.       call turn
  122.      else
  123.       if result = 'B' then
  124.        call down
  125.       else
  126.        if result = 'C' then
  127.         call rechts
  128.        else
  129.         if result = 'D' then
  130.          call links
  131.         else do
  132.          call advance
  133.          getcarrier
  134.          if result~='TRUE' then call ende
  135.         end
  136.     end
  137.    end
  138.    otherwise do
  139.     call advance
  140.     getcarrier
  141.     if result~='TRUE' then call ende
  142.    end
  143.   end
  144.  end
  145.  
  146. /* _togglenext --- switch the view of next piece on/off                      */
  147.  
  148. togglenext:
  149.  if naechst=1 then do
  150.   call gotoxy(-16,12)
  151.   send '    DDDDB    DDDDB    DDDDB    '
  152.   naechst=0
  153.   end
  154.  else do
  155.   call gotoxy(-16,12)
  156.   send part.nexpiece
  157.   naechst=1
  158.  end
  159.  return
  160.  
  161. /* _pause --- take a brake and wait for a key                                */
  162.  
  163. pause:
  164.  result=''
  165.  do while result~='p'
  166.   maygetchar
  167.  end
  168.  return
  169.  
  170. /* _down --- drop the piece right on the floor                               */
  171.  
  172. down:
  173.  do i=0 to 3
  174.   y=akty+i
  175.   /* thanks to Tobias 'Top' Walter who helped me to find the bitxor bug */
  176.   zeile.y=substr(c2b(bitxor(substr(b2c(zeile.y),1,14),b2c(left(right(mask.piece.i,aktx+6,'0'),16,'0')),'0')),3,14)
  177.  end
  178.  max=akty
  179.  do j=akty to 16
  180.   px=aktx ; py=j
  181.   call passt
  182.   if ret=1 then
  183.    max=j
  184.   else
  185.    leave
  186.  end
  187.  call gotoxy(aktx,akty)
  188.  send npart.piece
  189.  akty=max
  190.  call gotoxy(aktx,akty)
  191.  send part.piece
  192.  do i=0 to 3
  193.   y=akty+i
  194.   zeile.y=bitor(zeile.y,right(mask.piece.i,aktx+4,'0'),'0')
  195.  end
  196.  return
  197.  
  198. /* _links --- left is reserved, so the move is called by the german word     */
  199.  
  200. links:
  201.  do i=0 to 3
  202.   y=akty+i
  203.   zeile.y=substr(c2b(bitxor(substr(b2c(zeile.y),1,14),b2c(left(right(mask.piece.i,aktx+6,'0'),16,'0')),'0')),3,14)
  204.  end
  205.  px=aktx-1 ; py=akty
  206.  call passt
  207.  if ret then do
  208.   call gotoxy(aktx,akty)
  209.   send npart.piece
  210.   aktx=aktx-1
  211.   call gotoxy(aktx,akty)
  212.   send part.piece
  213.  end
  214.  do i=0 to 3
  215.   y=akty+i
  216.   zeile.y=bitor(zeile.y,right(mask.piece.i,aktx+4,'0'),'0')
  217.  end
  218.  return
  219.  
  220. /* _rechts --- right is reserved, so the move is called by the german word   */
  221.  
  222. rechts:
  223.  do i=0 to 3
  224.   y=akty+i
  225.   zeile.y=substr(c2b(bitxor(substr(b2c(zeile.y),1,14),b2c(left(right(mask.piece.i,aktx+6,'0'),16,'0')),'0')),3,14)
  226.  end
  227.  px=aktx+1 ; py=akty
  228.  call passt
  229.  if ret then do
  230.   call gotoxy(aktx,akty)
  231.   send npart.piece
  232.   aktx=aktx+1
  233.   call gotoxy(aktx,akty)
  234.   send part.piece
  235.  end
  236.  do i=0 to 3
  237.   y=akty+i
  238.   zeile.y=bitor(zeile.y,right(mask.piece.i,aktx+4,'0'),'0')
  239.  end
  240.  return
  241.  
  242. /* _turn --- rotate the piece clockwise                                      */
  243.  
  244. turn:
  245.  do i=0 to 3
  246.   y=akty+i
  247.   zeile.y=substr(c2b(bitxor(substr(b2c(zeile.y),1,14),b2c(left(right(mask.piece.i,aktx+6,'0'),16,'0')),'0')),3,14)
  248.  end
  249.  altpiece=piece
  250.  piece=nextpiece.piece
  251.  px=aktx ; py=akty
  252.  call passt
  253.  if ret then do
  254.   call gotoxy(aktx,akty)
  255.   send npart.altpiece
  256.   call gotoxy(aktx,akty)
  257.   send part.piece
  258.  end
  259.  else
  260.   piece=altpiece
  261.  do i=0 to 3
  262.   y=akty+i
  263.   zeile.y=bitor(zeile.y,right(mask.piece.i,aktx+4,'0'),'0')
  264.  end
  265.  return
  266.  
  267. /* _turnback --- rotate the piece anti-clockwise                             */
  268.  
  269. turnback:
  270.  do i=0 to 3
  271.   y=akty+i
  272.   zeile.y=substr(c2b(bitxor(substr(b2c(zeile.y),1,14),b2c(left(right(mask.piece.i,aktx+6,'0'),16,'0')),'0')),3,14)
  273.  end
  274.  altpiece=piece
  275.  piece=prevpiece.piece
  276.  px=aktx ; py=akty
  277.  call passt
  278.  if ret then do
  279.   call gotoxy(aktx,akty)
  280.   send npart.altpiece
  281.   call gotoxy(aktx,akty)
  282.   send part.piece
  283.  end
  284.  else
  285.   piece=altpiece
  286.  do i=0 to 3
  287.   y=akty+i
  288.   zeile.y=bitor(zeile.y,right(mask.piece.i,aktx+4,'0'),'0')
  289.  end
  290.  return
  291.  
  292. /* _advance --- simply go on one step                                        */
  293.  
  294. advance:
  295.  nochnadvance=1
  296.  do while nochnadvance
  297.   if piece = 0 then do
  298.    if substr(zeile.1,2,10)~='0000000000' then call ende
  299.    call grand
  300.    piece=nexpiece
  301.    nexpiece=randx*numpieces
  302.    nexpiece=substr(nexpiece,1,pos('.',nexpiece)-1)
  303.    do while nexpiece=0
  304.     call randomize
  305.     call grand
  306.     nexpiece=randx*numpieces
  307.     nexpiece=substr(nexpiece,1,pos('.',nexpiece)-1)
  308.    end
  309.    if naechst then do
  310.     call gotoxy(-16,12)
  311.     send '    DDDDB    DDDDB    DDDDB    '
  312.     call gotoxy(-16,12)
  313.     send part.nexpiece
  314.    end
  315.    aktx = 5 ; akty = 0
  316.   end
  317.   else
  318.    do i=0 to 3
  319.     y=akty+i
  320.     zeile.y=substr(c2b(bitxor(substr(b2c(zeile.y),1,14),b2c(left(right(mask.piece.i,aktx+6,'0'),16,'0')),'0')),3,14)
  321.    end
  322.   px=aktx ; py=akty+1
  323.   call passt
  324.   if ret then do
  325.    call gotoxy(aktx,akty)
  326.    send npart.piece
  327.    akty = akty+1
  328.    call gotoxy(aktx,akty)
  329.    send part.piece
  330.    do i=0 to 3
  331.     y=akty+i
  332.     zeile.y=bitor(zeile.y,right(mask.piece.i,aktx+4,'0'),'0')
  333.    end
  334.    nochnadvance=0
  335.   end
  336.   else do
  337.    pieces=pieces+1
  338.    call gotoxy(-16,8)
  339.    send pieces
  340.    aufeinmal=0
  341.    do i=0 to 3
  342.     y=akty+i
  343.     zeile.y=bitor(zeile.y,right(mask.piece.i,aktx+4,'0'),'0')
  344.     if substr(zeile.y,2,10)='1111111111' & y<16 then do
  345.      aufeinmal=aufeinmal+1
  346.      j=y+1
  347.      do while j>0 & substr(zeile.j,2,10)~='0000000000'
  348.       j=j-1
  349.       g=j-1
  350.       zeile.j=zeile.g
  351.       call gotoxy(1,j)
  352.       send substr(translate(zeile.j,offchar||onchar,'01'),2,10)
  353.      end
  354.      lines=lines+1
  355.      call gotoxy(-16,6)
  356.      send lines
  357.     end
  358.    end
  359.    if zeile.15='10000000000111' then
  360.     score = score + 1000 - naechst*500
  361.    score = score + aufeinmal*aufeinmal*100 - naechst*aufeinmal*aufeinmal*50
  362.    score = score + 2*points.piece - naechst*points.piece
  363.    call gotoxy(-16,2)
  364.    send score
  365.    if score//liftit=0 & score>3000 then do
  366.     call grand
  367.     newline='1'||right(c2b(d2c(substr(1023*randx,1,pos('.',1023*randx)-1))),10,'0')||'111'
  368.     do i=0 to 14
  369.      j=i+1
  370.      zeile.i=zeile.j
  371.      call gotoxy(1,i)
  372.      send substr(translate(zeile.i,offchar||onchar,'01'),2,10)
  373.     end
  374.     zeile.15=newline
  375.     call gotoxy(1,15)
  376.     send substr(translate(zeile.15,offchar||onchar,'01'),2,10)
  377.    end
  378.    piece=0
  379.    call advance
  380.   end
  381.  end
  382.  return
  383.  
  384. /* _passt --- checks if a piece fits into the next place                     */
  385.  
  386. passt:
  387.  ret=1
  388.  do i=0 to 3
  389.   y=py+i
  390.   if bitand(zeile.y,right(mask.piece.i,px+4,'0'),'0')~='00000000000000' then
  391.    ret=0
  392.  end
  393.  return
  394.  
  395. /* _clear --- rebuild the playfield                                          */
  396.  
  397. clear:
  398.  send ''
  399.  sendfile screen
  400.  send '¢0 p'
  401.  do y=0 to 15
  402.   zeile.y='10000000000111'
  403.  end
  404.  do y=16 to 20
  405.   zeile.y='11111111111111'
  406.  end
  407.  if open('scorelist',topfile,'R') then do
  408.   highname=readln('scorelist')
  409.   highpoints=readln('scorelist')
  410.   call close('scorelist')
  411.  end
  412.  call gotoxy(-16,4)
  413.  send highpoints
  414.  call gotoxy(-16,2)
  415.  send score
  416.  piece=0
  417.  lines=0
  418.  pieces=0
  419.  naechst=1
  420.  call randomize
  421.  call grand
  422.  nexpiece=randx*numpieces
  423.  if pos('.',nexpiece) >1 then nexpiece=substr(nexpiece,1,pos('.',nexpiece)-1)
  424.  do i=0 to 15
  425.   call gotoxy(1,i)
  426.   send offchar||offchar||offchar||offchar||offchar||offchar||offchar||offchar||offchar||offchar
  427.  end
  428.  return carrier
  429.  
  430. /* _gotoxy --- position the cursor inside of the playfield                   */
  431.  
  432. gotoxy: procedure
  433.  arg x,y
  434.  send ''||y+1||';'||x+20||'H'
  435.  return
  436.  
  437. /* _grand --- a better randomroutine than random(). uses a chaosfunction     */
  438.              /* thanks to Lorenz Stoessel for this routine */
  439.  
  440. grand:
  441.  randx=randr*randx*(1-randx)
  442.  return
  443.  
  444. /* _randomize --- init the random-routine                                    */
  445.  
  446. randomize:
  447.  randx=substr(time(),7,2)/60
  448.  randr=substr(time(),4,2)*2/300+3.6
  449.  return
  450.  
  451. /* _displayscore --- show the scores                                         */
  452.  
  453. displayscore:
  454.  send '0c'x
  455.  if open('scorelist',topfile,'R') then do
  456.   do i=1 to 10
  457.    name.i=readln('scorelist')
  458.    points.i=readln('scorelist')
  459.   end
  460.   call close('scorelist')
  461.  end
  462.  i=1
  463.  do while points.i>score & i<11
  464.   i=i+1
  465.  end
  466.  userinfo a ; uname=result
  467.  if i=1 & timeback then do
  468.   systeminfo q
  469.   settime result
  470.   send '0c'x
  471.   print ''
  472.   print '    You are on the first place and have now your full time again!'
  473.   print ''
  474.   continue
  475.  end
  476.  if i<11 & uname~=sysopname then do
  477.   do j=11 to i+1 by -1
  478.    k=j-1
  479.    name.j=name.k
  480.    points.j=points.k
  481.   end
  482.   name.i=uname
  483.   points.i=score
  484.   call open('scorelist',topfile,'W')
  485.   do i=1 to 10
  486.    call writeln('scorelist',name.i)
  487.    call writeln('scorelist',points.i)
  488.   end
  489.   call close('scorelist')
  490.  end
  491.  send '0c'x
  492.  print '       GiTAris Top Ten! '
  493.  print ''
  494.  do i=1 to 10
  495.   print '       '||right(i,3,' ')||'. -> '||left(name.i,20,' ')||' Score: '||points.i
  496.  end
  497.  continue
  498.  return
  499.  
  500. /* _exit --- global exit (err & norm)                                        */
  501.  
  502. ende:
  503.  bufferflush
  504.  call displayscore
  505.  exit
  506.  
  507. /* _settingsmenu --- display & parse the mainmenu of GiTAris                 */
  508.  
  509. settingsmenu:
  510.  send '0c'x
  511.  userinfo 1 ; xpert=upper(result)
  512.  score=0
  513.  onchar = '█'
  514.  offchar = '│'
  515.  cmd=''
  516.  do until cmd='N' | cmd='T'
  517.   if xpert='NOVICE' then do
  518.    sendmenu 'gitarismenu'
  519.    call gotoxy(28,10)
  520.    send onchar
  521.    call gotoxy(28,11)
  522.    send offchar
  523.    call gotoxy(-19,18)
  524.   end
  525.   systeminfo m ; time=result
  526.   getcmd '[GiTAris - T: '||time||', C: ? + N T S B V H ]' ; cmd=upper(result)
  527.   getcarrier
  528.   if result~='TRUE' then call ende
  529.   select
  530.    when cmd='?' then
  531.     if xpert~='NOVICE' then do
  532.      sendmenu 'gitarismenu'
  533.      call gotoxy(28,10)
  534.      send onchar
  535.      call gotoxy(28,11)
  536.      send offchar
  537.      call gotoxy(-19,18)
  538.     end
  539.    when cmd='+' then call ende
  540.    when cmd='N' then numpieces=28       /* NUMBER OF NORMAL PIECES */
  541.    when cmd='T' then numpieces=48       /* TOTAL NUMBER OF PIECES */
  542.    when cmd='S' then call displayscore
  543.    when cmd='B' then sendfile helpfile
  544.    when cmd='V' then do
  545.     if xpert~='NOVICE' then do
  546.      sendmenu 'gitarismenu'
  547.      call gotoxy(28,10)
  548.      send onchar
  549.      call gotoxy(28,11)
  550.      send offchar
  551.      call gotoxy(-19,18)
  552.     end
  553.     call gotoxy(28,10)
  554.     getchar
  555.     onchar=result
  556.     sendmenu 'gitarismenu'
  557.     call gotoxy(28,10)
  558.     send onchar
  559.     call gotoxy(28,11)
  560.     send offchar
  561.     call gotoxy(-19,18)
  562.    end
  563.    when cmd='H' then do
  564.     if xpert~='NOVICE' then do
  565.      sendmenu 'gitarismenu'
  566.      call gotoxy(28,10)
  567.      send onchar
  568.      call gotoxy(28,11)
  569.      send offchar
  570.      call gotoxy(-19,18)
  571.     end
  572.     call gotoxy(28,11)
  573.     getchar
  574.     offchar=result
  575.     sendmenu 'gitarismenu'
  576.     call gotoxy(28,10)
  577.     send onchar
  578.     call gotoxy(28,11)
  579.     send offchar
  580.     call gotoxy(-19,18)
  581.    end
  582.    otherwise print "Unknown command, press '?' for menu!"
  583.   end
  584.  end
  585.  return
  586.  
  587. /* _error, _ioerr, _syntax --- errorhandling... */
  588.  
  589. ioerr: say 'ioerr '||errortext(rc)||' line '||sigl
  590. syntax: say 'syntax '||errortext(rc)||' line '||sigl
  591. error: say 'error '||errortext(rc)||' line '||sigl
  592.  send '0c'x
  593.  print 'An error '||errortext(rc)||' in line '||sigl||' hast been detected.'
  594.  print 'Please inform SysOp!'
  595.  contiune
  596.  exit
  597.  
  598. /* _init --- definition of all tetris pieces                                 */
  599.  
  600. /* from here to the end is only DATA. look at the end of the script for
  601.    instructions how to change the pieces !                                   */
  602.  
  603. init:
  604.  
  605. /*XX..
  606.   XX..
  607.   ....
  608.   ....   this piece four times to retain statistical equality */
  609.  
  610.  mask.1.0='1100' ; mask.2.0=mask.1.0 ; mask.3.0=mask.1.0 ; mask.4.0=mask.1.0
  611.  mask.1.1='1100' ; mask.2.1=mask.1.1 ; mask.3.1=mask.1.1 ; mask.4.1=mask.1.1
  612.  mask.1.2='0000' ; mask.2.2=mask.1.2 ; mask.3.2=mask.1.2 ; mask.4.2=mask.1.2
  613.  mask.1.3='0000' ; mask.2.3=mask.1.3 ; mask.3.3=mask.1.3 ; mask.4.3=mask.1.3
  614.  
  615.  part.1 = onchar||onchar||'BDD'||onchar||onchar ; part.2=part.1 ; part.3=part.1 ; part.4=part.1
  616.  npart.1 = offchar||offchar||'BDD'||offchar||offchar ; npart.2=npart.1 ; npart.3=npart.1 ; npart.4=npart.1
  617.  nextpiece.1 = 1 ; nextpiece.2 = 2   ; nextpiece.3 = 3   ; nextpiece.4 = 4
  618.  prevpiece.1 = 1 ; prevpiece.2 = 2   ; prevpiece.3 = 3   ; prevpiece.4 = 4
  619.  points.1 = 10   ; points.2 = 10     ; points.3 = 10     ; points.4 = 10
  620.  
  621. /*.X..
  622.   .X..
  623.   .X..
  624.   .X..   this piece two times to retain statistical equality */
  625.  
  626.  mask.5.0='0100' ; mask.6.0=mask.5.0
  627.  mask.5.1='0100' ; mask.6.1=mask.5.1
  628.  mask.5.2='0100' ; mask.6.2=mask.5.2
  629.  mask.5.3='0100' ; mask.6.3=mask.5.3
  630.  
  631.  part.5 = 'C'||onchar||'BD'||onchar||'BD'||onchar||'BD'||onchar ; part.6=part.5
  632.  npart.5 = 'C'||offchar||'BD'||offchar||'BD'||offchar||'BD'||offchar ; npart.6=npart.5
  633.  nextpiece.5 = 7 ; nextpiece.6 = 8
  634.  prevpiece.5 = 7 ; prevpiece.6 = 8
  635.  points.5 = 10 ; points.6 = 10
  636.  
  637. /*....
  638.   XXXX
  639.   ....
  640.   ....*/
  641.  
  642.  mask.7.0='0000' ; mask.8.0=mask.7.0
  643.  mask.7.1='1111' ; mask.8.1=mask.7.1
  644.  mask.7.2='0000' ; mask.8.2=mask.7.2
  645.  mask.7.3='0000' ; mask.8.3=mask.7.3
  646.  
  647.  part.7 = 'B'||onchar||onchar||onchar||onchar ; part.8=part.7
  648.  npart.7 = 'B'||offchar||offchar||offchar||offchar ; npart.8=npart.7
  649.  nextpiece.7 = 5 ; nextpiece.8 = 6
  650.  prevpiece.7 = 5 ; prevpiece.8 = 6
  651.  points.7 = 10 ; points.8 = 10
  652.  
  653. /*....
  654.   XXX.
  655.   .X..
  656.   ....*/
  657.  
  658.  mask.9.0='0000'
  659.  mask.9.1='1110'
  660.  mask.9.2='0100'
  661.  mask.9.3='0000'
  662.  
  663.  part.9 = 'B'||onchar||onchar||onchar||'BDD'||onchar
  664.  npart.9 = 'B'||offchar||offchar||offchar||'BDD'||offchar
  665.  nextpiece.9 = 10
  666.  prevpiece.9 = 12
  667.  points.9 = 15
  668.  
  669. /*.X..
  670.   XX..
  671.   .X..
  672.   ....*/
  673.  
  674.  mask.10.0='0100'
  675.  mask.10.1='1100'
  676.  mask.10.2='0100'
  677.  mask.10.3='0000'
  678.  
  679.  part.10 = 'C'||onchar||'DDB'||onchar||onchar||'DB'||onchar
  680.  npart.10 = 'C'||offchar||'DDB'||offchar||offchar||'DB'||offchar
  681.  nextpiece.10 = 11
  682.  prevpiece.10 = 9
  683.  points.10 = 15
  684.  
  685. /*.X..
  686.   XXX.
  687.   ....
  688.   ....*/
  689.  
  690.  mask.11.0='0100'
  691.  mask.11.1='1110'
  692.  mask.11.2='0000'
  693.  mask.11.3='0000'
  694.  
  695.  part.11 = 'C'||onchar||'DDB'||onchar||onchar||onchar
  696.  npart.11 = 'C'||offchar||'DDB'||offchar||offchar||offchar
  697.  nextpiece.11 = 12
  698.  prevpiece.11 = 10
  699.  points.11 = 15
  700.  
  701. /*.X..
  702.   .XX.
  703.   .X..
  704.   ....*/
  705.  
  706.  mask.12.0='0100'
  707.  mask.12.1='0110'
  708.  mask.12.2='0100'
  709.  mask.12.3='0000'
  710.  
  711.  part.12 = 'C'||onchar||'BD'||onchar||onchar||'DDB'||onchar
  712.  npart.12 = 'C'||offchar||'BD'||offchar||offchar||'DDB'||offchar
  713.  nextpiece.12 = 9
  714.  prevpiece.12 = 11
  715.  points.12 = 15
  716.  
  717. /*.X..
  718.   .X..
  719.   .XX.
  720.   ....*/
  721.  
  722.  mask.13.0='0100'
  723.  mask.13.1='0100'
  724.  mask.13.2='0110'
  725.  mask.13.3='0000'
  726.  
  727.  part.13 = 'C'||onchar||'BD'||onchar||'BD'||onchar||onchar
  728.  npart.13 = 'C'||offchar||'BD'||offchar||'BD'||offchar||offchar
  729.  nextpiece.13 = 14
  730.  prevpiece.13 = 16
  731.  points.13 = 20
  732.  
  733. /*....
  734.   XXX.
  735.   X...
  736.   ....*/
  737.  
  738.  mask.14.0='0000'
  739.  mask.14.1='1110'
  740.  mask.14.2='1000'
  741.  mask.14.3='0000'
  742.  
  743.  part.14 = 'B'||onchar||onchar||onchar||'DDDB'||onchar
  744.  npart.14 = 'B'||offchar||offchar||offchar||'DDDB'||offchar
  745.  nextpiece.14 = 15
  746.  prevpiece.14 = 13
  747.  points.14 = 20
  748.  
  749. /*XX..
  750.   .X..
  751.   .X..
  752.   ....*/
  753.  
  754.  mask.15.0='1100'
  755.  mask.15.1='0100'
  756.  mask.15.2='0100'
  757.  mask.15.3='0000'
  758.  
  759.  part.15 = onchar||onchar||'DB'||onchar||'DB'||onchar
  760.  npart.15 = offchar||offchar||'DB'||offchar||'DB'||offchar
  761.  nextpiece.15 = 16
  762.  prevpiece.15 = 14
  763.  points.15 = 20
  764.  
  765. /*..X.
  766.   XXX.
  767.   ....
  768.   ....*/
  769.  
  770.  mask.16.0='0010'
  771.  mask.16.1='1110'
  772.  mask.16.2='0000'
  773.  mask.16.3='0000'
  774.  
  775.  part.16 = 'CC'||onchar||'DDDB'||onchar||onchar||onchar
  776.  npart.16 = 'CC'||offchar||'DDDB'||offchar||offchar||offchar
  777.  nextpiece.16 = 13
  778.  prevpiece.16 = 15
  779.  points.16 = 20
  780.  
  781. /*.X..
  782.   .X..
  783.   XX..
  784.   ....*/
  785.  
  786.  mask.17.0='0100'
  787.  mask.17.1='0100'
  788.  mask.17.2='1100'
  789.  mask.17.3='0000'
  790.  
  791.  part.17 = 'C'||onchar||'DB'||onchar||'DDB'||onchar||onchar
  792.  npart.17 = 'C'||offchar||'DB'||offchar||'DDB'||offchar||offchar
  793.  nextpiece.17 = 18
  794.  prevpiece.17 = 20
  795.  points.17 = 20
  796.  
  797. /*X...
  798.   XXX.
  799.   ....
  800.   ....*/
  801.  
  802.  mask.18.0='1000'
  803.  mask.18.1='1110'
  804.  mask.18.2='0000'
  805.  mask.18.3='0000'
  806.  
  807.  part.18 = onchar||'DB'||onchar||onchar||onchar
  808.  npart.18 = offchar||'DB'||offchar||offchar||offchar
  809.  nextpiece.18 = 19
  810.  prevpiece.18 = 17
  811.  points.18 = 20
  812.  
  813. /*.XX.
  814.   .X..
  815.   .X..
  816.   ....*/
  817.  
  818.  mask.19.0='0110'
  819.  mask.19.1='0100'
  820.  mask.19.2='0100'
  821.  mask.19.3='0000'
  822.  
  823.  part.19 = 'C'||onchar||onchar||'DDB'||onchar||'DB'||onchar
  824.  npart.19 = 'C'||offchar||offchar||'DDB'||offchar||'DB'||offchar
  825.  nextpiece.19 = 20
  826.  prevpiece.19 = 18
  827.  points.19 = 20
  828.  
  829. /*....
  830.   XXX.
  831.   ..X.
  832.   ....*/
  833.  
  834.  mask.20.0='0000'
  835.  mask.20.1='1110'
  836.  mask.20.2='0010'
  837.  mask.20.3='0000'
  838.  
  839.  part.20 = 'B'||onchar||onchar||onchar||'DB'||onchar
  840.  npart.20 = 'B'||offchar||offchar||offchar||'DB'||offchar
  841.  nextpiece.20 = 17
  842.  prevpiece.20 = 19
  843.  points.20 = 20
  844.  
  845. /*XX..
  846.   .XX.
  847.   ....
  848.   ....   this piece two times to retain statistical equality */
  849.  
  850.  mask.21.0='1100' ; mask.22.0=mask.21.0
  851.  mask.21.1='0110' ; mask.22.1=mask.21.1
  852.  mask.21.2='0000' ; mask.22.2=mask.21.2
  853.  mask.21.3='0000' ; mask.22.3=mask.21.3
  854.  
  855.  part.21 = onchar||onchar||'DB'||onchar||onchar ; part.22=part.21
  856.  npart.21 = offchar||offchar||'DB'||offchar||offchar ; npart.22=npart.21
  857.  nextpiece.21 = 23 ; nextpiece.22 = 24
  858.  prevpiece.21 = 23 ; prevpiece.22 = 24
  859.  points.21 = 20 ; points.22 = 20
  860.  
  861. /*.X..
  862.   XX..
  863.   X...
  864.   ....   this piece two times to retain statistical equality */
  865.  
  866.  mask.23.0='0100' ; mask.24.0=mask.23.0
  867.  mask.23.1='1100' ; mask.24.1=mask.23.1
  868.  mask.23.2='1000' ; mask.24.2=mask.23.2
  869.  mask.23.3='0000' ; mask.24.3=mask.23.3
  870.  
  871.  part.23 = 'C'||onchar||'DDB'||onchar||onchar||'DDB'||onchar ; part.24=part.23
  872.  npart.23 = 'C'||offchar||'DDB'||offchar||offchar||'DDB'||offchar ; npart.24=npart.23
  873.  nextpiece.23 = 21 ; nextpiece.24 = 22
  874.  prevpiece.23 = 21 ; prevpiece.24 = 22
  875.  points.23 = 20 ; points.24 = 20
  876.  
  877. /*.XX.
  878.   XX..
  879.   ....
  880.   ....   this piece two times to retain statistical equality */
  881.  
  882.  mask.25.0='0110' ; mask.26.0=mask.25.0
  883.  mask.25.1='1100' ; mask.26.1=mask.25.1
  884.  mask.25.2='0000' ; mask.26.2=mask.25.2
  885.  mask.25.3='0000' ; mask.26.3=mask.25.3
  886.  
  887.  part.25 = 'C'||onchar||onchar||'DDDB'||onchar||onchar ; part.26=part.25
  888.  npart.25 = 'C'||offchar||offchar||'DDDB'||offchar||offchar ; npart.26=npart.25
  889.  nextpiece.25 = 27 ; nextpiece.26 = 28
  890.  prevpiece.25 = 27 ; prevpiece.26 = 28
  891.  points.25 = 20 ; points.26 = 20
  892.  
  893. /*X...
  894.   XX..
  895.   .X..
  896.   ....   this piece two times to retain statistical equality */
  897.  
  898.  mask.27.0='1000' ; mask.28.0=mask.27.0
  899.  mask.27.1='1100' ; mask.28.1=mask.27.1
  900.  mask.27.2='0100' ; mask.28.2=mask.27.2
  901.  mask.27.3='0000' ; mask.28.3=mask.27.3
  902.  
  903.  part.27 = onchar||'DB'||onchar||onchar||'DB'||onchar ; part.28=part.27
  904.  npart.27 = offchar||'DB'||offchar||offchar||'DB'||offchar ; npart.28=npart.27
  905.  nextpiece.27 = 25 ; nextpiece.28 = 26
  906.  prevpiece.27 = 25 ; prevpiece.28 = 26
  907.  points.27 = 20 ; points.28 = 20
  908.  
  909. /*.X..
  910.   ....
  911.   ....
  912.   ....*/
  913.  
  914.  mask.29.0='0100' ; mask.30.0=mask.29.0 ; mask.31.0=mask.29.0 ; mask.32.0=mask.29.0
  915.  mask.29.1='0000' ; mask.30.1=mask.29.1 ; mask.31.1=mask.29.1 ; mask.32.1=mask.29.1
  916.  mask.29.2='0000' ; mask.30.2=mask.29.2 ; mask.31.2=mask.29.2 ; mask.32.2=mask.29.2
  917.  mask.29.3='0000' ; mask.30.3=mask.29.3 ; mask.31.3=mask.29.3 ; mask.32.3=mask.29.3
  918.  
  919.  part.29 = 'C'||onchar ; part.30=part.29 ; part.31=part.29 ; part.32=part.29
  920.  npart.29 = 'C'||offchar ; npart.30=npart.29 ; npart.31=npart.29 ; npart.32=npart.29
  921.  nextpiece.29 = 29 ; nextpiece.30 = 30 ; nextpiece.31 = 31 ; nextpiece.32 = 32
  922.  prevpiece.29 = 29 ; prevpiece.30 = 30 ; prevpiece.31 = 31 ; prevpiece.32 = 32
  923.  points.29 = 5 ; points.30 = 5 ; points.31 = 5 ; points.32 = 5 ;
  924.  
  925. /*.X..
  926.   XXXX
  927.   ....
  928.   ....*/
  929.  
  930.  mask.33.0='0100'
  931.  mask.33.1='1111'
  932.  mask.33.2='0000'
  933.  mask.33.3='0000'
  934.  
  935.  part.33 = 'C'||onchar||'DDB'||onchar||onchar||onchar||onchar
  936.  npart.33 = 'C'||offchar||'DDB'||offchar||offchar||offchar||offchar
  937.  nextpiece.33 = 34
  938.  prevpiece.33 = 36
  939.  points.33 = 25
  940.  
  941. /*.X..
  942.   .XX.
  943.   .X..
  944.   .X..*/
  945.  
  946.  mask.34.0='0100'
  947.  mask.34.1='0110'
  948.  mask.34.2='0100'
  949.  mask.34.3='0100'
  950.  
  951.  part.34 = 'C'||onchar||'DB'||onchar||onchar||'DDB'||onchar||'DB'||onchar
  952.  npart.34 = 'C'||offchar||'DB'||offchar||offchar||'DDB'||offchar||'DB'||offchar
  953.  nextpiece.34 = 35
  954.  prevpiece.34 = 33
  955.  points.34 = 25
  956.  
  957. /*....
  958.   XXXX
  959.   ..X.
  960.   ....*/
  961.  
  962.  mask.35.0='0000'
  963.  mask.35.1='1111'
  964.  mask.35.2='0010'
  965.  mask.35.3='0000'
  966.  
  967.  part.35 = 'B'||onchar||onchar||onchar||onchar||'DDB'||onchar
  968.  npart.35 = 'B'||offchar||offchar||offchar||offchar||'DDB'||offchar
  969.  nextpiece.35 = 36
  970.  prevpiece.35 = 34
  971.  points.35 = 25
  972.  
  973. /*.X..
  974.   .X..
  975.   XX..
  976.   .X..*/
  977.  
  978.  mask.36.0='0100'
  979.  mask.36.1='0100'
  980.  mask.36.2='1100'
  981.  mask.36.3='0100'
  982.  
  983.  part.36 = 'C'||onchar||'DB'||onchar||'DDB'||onchar||onchar||'DB'||onchar
  984.  npart.36 = 'C'||offchar||'DB'||offchar||'DDB'||offchar||offchar||'DB'||offchar
  985.  nextpiece.36 = 33
  986.  prevpiece.36 = 35
  987.  points.36 = 25
  988.  
  989. /*....
  990.   X.X.
  991.   XXX.
  992.   ....*/
  993.  
  994.  mask.37.0='0000'
  995.  mask.37.1='1010'
  996.  mask.37.2='1110'
  997.  mask.37.3='0000'
  998.  
  999.  part.37 = 'B'||onchar||'C'||onchar||'DDDB'||onchar||onchar||onchar
  1000.  npart.37 = 'B'||offchar||'C'||offchar||'DDDB'||offchar||offchar||offchar
  1001.  nextpiece.37 = 38
  1002.  prevpiece.37 = 40
  1003.  points.37 = 25
  1004.  
  1005. /*XX..
  1006.   X...
  1007.   XX..
  1008.   ....*/
  1009.  
  1010.  mask.38.0='1100'
  1011.  mask.38.1='1000'
  1012.  mask.38.2='1100'
  1013.  mask.38.3='0000'
  1014.  
  1015.  part.38 = onchar||onchar||'DDB'||onchar||'DB'||onchar||onchar
  1016.  npart.38 = offchar||offchar||'DDB'||offchar||'DB'||offchar||offchar
  1017.  nextpiece.38 = 39
  1018.  prevpiece.38 = 37
  1019.  points.38 = 25
  1020.  
  1021. /*XXX.
  1022.   X.X.
  1023.   ....
  1024.   ....*/
  1025.  
  1026.  mask.39.0='1110'
  1027.  mask.39.1='1010'
  1028.  mask.39.2='0000'
  1029.  mask.39.3='0000'
  1030.  
  1031.  part.39 = onchar||onchar||onchar||'DDDB'||onchar||'C'||onchar
  1032.  npart.39 = offchar||offchar||offchar||'DDDB'||offchar||'C'||offchar
  1033.  nextpiece.39 = 40
  1034.  prevpiece.39 = 38
  1035.  points.39 = 25
  1036.  
  1037. /*.XX.
  1038.   ..X.
  1039.   .XX.
  1040.   ....*/
  1041.  
  1042.  mask.40.0='0110'
  1043.  mask.40.1='0110'
  1044.  mask.40.2='0110'
  1045.  mask.40.3='0110'
  1046.  
  1047.  part.40 = 'C'||onchar||onchar||'DB'||onchar||'DDB'||onchar||onchar
  1048.  npart.40 = 'C'||offchar||offchar||'DB'||offchar||'DDB'||offchar||offchar
  1049.  nextpiece.40 = 37
  1050.  prevpiece.40 = 39
  1051.  points.40 = 25
  1052.  
  1053. /*.X..
  1054.   .X..
  1055.   .X..
  1056.   ....*/
  1057.  
  1058.  mask.41.0='0100'
  1059.  mask.41.1='0100'
  1060.  mask.41.2='0100'
  1061.  mask.41.3='0000'
  1062.  
  1063.  part.41 = 'C'||onchar||'DB'||onchar||'DB'||onchar
  1064.  npart.41 = 'C'||offchar||'DB'||offchar||'DB'||offchar
  1065.  nextpiece.41 = 41
  1066.  prevpiece.41 = 48
  1067.  points.41 = 2
  1068.  
  1069. /*..X.
  1070.   .X..
  1071.   X...
  1072.   ....*/
  1073.  
  1074.  mask.42.0='0010'
  1075.  mask.42.1='0100'
  1076.  mask.42.2='1000'
  1077.  mask.42.3='0000'
  1078.  
  1079.  part.42 = 'CC'||onchar||'DDB'||onchar||'DDB'||onchar
  1080.  npart.42 = 'CC'||offchar||'DDB'||offchar||'DDB'||offchar
  1081.  nextpiece.42 = 43
  1082.  prevpiece.42 = 41
  1083.  points.42 = 2
  1084.  
  1085. /*....
  1086.   XXX.
  1087.   ....
  1088.   ....*/
  1089.  
  1090.  mask.43.0='0000'
  1091.  mask.43.1='1110'
  1092.  mask.43.2='0000'
  1093.  mask.43.3='0000'
  1094.  
  1095.  part.43 = 'B'||onchar||onchar||onchar
  1096.  npart.43 = 'B'||offchar||offchar||offchar
  1097.  nextpiece.43 = 44
  1098.  prevpiece.43 = 42
  1099.  points.43 = 2
  1100.  
  1101. /*X...
  1102.   .X..
  1103.   ..X.
  1104.   ....*/
  1105.  
  1106.  mask.44.0='1000'
  1107.  mask.44.1='0100'
  1108.  mask.44.2='0010'
  1109.  mask.44.3='0000'
  1110.  
  1111.  part.44 = onchar||'B'||onchar||'B'||onchar
  1112.  npart.44 = offchar||'B'||offchar||'B'||offchar
  1113.  nextpiece.44 = 45
  1114.  prevpiece.44 = 43
  1115.  points.44 = 2
  1116.  
  1117. /*.X..
  1118.   .X..
  1119.   .X..
  1120.   ....*/
  1121.  
  1122.  mask.45.0='0100'
  1123.  mask.45.1='0100'
  1124.  mask.45.2='0100'
  1125.  mask.45.3='0000'
  1126.  
  1127.  part.45 = 'C'||onchar||'DB'||onchar||'DB'||onchar
  1128.  npart.45 = 'C'||offchar||'DB'||offchar||'DB'||offchar
  1129.  nextpiece.45 = 46
  1130.  prevpiece.45 = 44
  1131.  points.45 = 2
  1132.  
  1133. /*..X.
  1134.   .X..
  1135.   X...
  1136.   ....*/
  1137.  
  1138.  mask.46.0='0010'
  1139.  mask.46.1='0100'
  1140.  mask.46.2='1000'
  1141.  mask.46.3='0000'
  1142.  
  1143.  part.46 = 'CC'||onchar||'DDB'||onchar||'DDB'||onchar
  1144.  npart.46 = 'CC'||offchar||'DDB'||offchar||'DDB'||offchar
  1145.  nextpiece.46 = 47
  1146.  prevpiece.46 = 45
  1147.  points.46 = 2
  1148.  
  1149. /*....
  1150.   XXX.
  1151.   ....
  1152.   ....*/
  1153.  
  1154.  mask.47.0='0000'
  1155.  mask.47.1='1110'
  1156.  mask.47.2='0000'
  1157.  mask.47.3='0000'
  1158.  
  1159.  part.47 = 'B'||onchar||onchar||onchar
  1160.  npart.47 = 'B'||offchar||offchar||offchar
  1161.  nextpiece.47 = 48
  1162.  prevpiece.47 = 46
  1163.  points.47 = 2
  1164.  
  1165. /*X...
  1166.   .X..
  1167.   ..X.
  1168.   ....*/
  1169.  
  1170.  mask.48.0='1000'
  1171.  mask.48.1='0100'
  1172.  mask.48.2='0010'
  1173.  mask.48.3='0000'
  1174.  
  1175.  part.48 = onchar||'B'||onchar||'B'||onchar
  1176.  npart.48 = offchar||'B'||offchar||'B'||offchar
  1177.  nextpiece.48 = 41
  1178.  prevpiece.48 = 47
  1179.  points.48 = 2
  1180.  
  1181. return
  1182.  
  1183. /*****************************************************************************/
  1184. /* YEAH! This is the end!!!!
  1185.    How about designing some more pieces?
  1186.  
  1187.    all you need:
  1188.  
  1189.    - a field of 4 4-byte strings containing the shape of it
  1190.      so, all pieces up to
  1191.                           XXXX
  1192.                           XXXX
  1193.                           XXXX
  1194.                           XXXX
  1195.                                are possible.
  1196.    - create a 'part' string with the ansicodes to display the piece
  1197.    - create a 'npart' string with the ansicodes to delete the piece
  1198.    - set the pointers to the 'nextpiece' when turning clockwise
  1199.      and to the 'prevpiece' when turning anti-clockwise
  1200.    - define the amount of points, the player will get when dropping
  1201.      this piece
  1202.    - ADJUST the "numpieces" Variable in 'settingsmenu:'
  1203. */
  1204.