home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Otherware
/
Otherware_1_SB_Development.iso
/
amiga
/
comms
/
bbs
/
gitaris.lzh
/
gitaris.trans
< prev
next >
Wrap
Text File
|
1992-02-17
|
31KB
|
1,204 lines
/*****************************************************************************/
/* */
/* GiTAris.trans Copyright '91, '92 by Georg 'Gio' Magschok */
/* */
/* Tetris (tm) - clone for TransAmiga BBS 1.1 */
/* */
/* Copyright: This script is public domain */
/* you can do anything you want with this program EXCEPT: */
/* - distributing modified versions under its original name */
/* - selling it for your profit */
/* */
/* The author takes no responsibility for anything... */
/* */
/* Installation: - put this one into bbs:rexx/ */
/* - be sure to have gitaris in bbs:text/ */
/* " gitarismenu in bbs:text/ */
/* - add the following line to your bbs:configs/extra.rx:
G GiTAris 050 -------- GiTAris.trans
*/
/* - ^^^^^^^^^^^^ change these to fit your needs */
/* */
/* Requiries: - TransAmiga 1.1 or later */
/* - *accelerated* Amiga (on 68000 it's quite slow :-) */
/* (I'm using it on 14MHz 68020 - that's sufficient!) */
/* */
/* Thanks to: - all my users for testing & playing */
/* especially Lorenz Stoessel who Tetris'ed like a fool... */
/* especially Christian Soerensen */
/* - Tobias 'Top' Walter for his ARexx-advice */
/* History: */
/* */
/* 30.08.91 Idea when programming Basic (ugly) 9.0.1 on HP 260 */
/* 31.08.91 began programming */
/* 03.09.91 speedup, important functions implemented */
/* 04.09.91 collisions are now detected, all normpieces implemented */
/* 05.09.91 added ANSI graphics, bugs removed */
/* hours of testing by Lorenz Stoessel (Thanks!) */
/* Highscores are being saved now */
/* 'Next' function and much more implemented */
/* 06.09.91 the first online-day for all users. some bugfixes */
/* each exact 1000 points, one line is inserted at the bottom */
/* 12.09.91 added Settingsmenu, Bugfixes */
/* */
/* 12.09.91 FIRST RELEASE-VERSION */
/* */
/* 13.09.91 fixed a bug when key pressed too early, better errorhandling */
/* 24.09.91 adaption to ABBEREXX 1.0 */
/* 23.01.92 fixed a bug in random-number generation */
/* 17.02.92 optical cleanup in the menu */
/* */
/* Future: */
/* except for some bugfixes, I'll do nothing more on this script. */
/* */
/* call Gio's home BBS +49-7202-2386 9600 8n1 24h 1500+files, TransAmiga 1.1 */
/*****************************************************************************/
options results
rc=0
sig=0
signal on error
signal on ioerr
signal on syntax
/* some globals you may need to adjust. */
timeback = 1 /* set 1 here, if the 1st place score shall get his time back */
liftit = 300 /* if score mod liftit=0 then insert a line! */
sysopname = 'GEORG MAGSCHOK' /* to be avoided in the highscorelist */
topfile = 'bbs:bulletins/GiTAris.top' /* where to put the topten-list */
screen = 'bbs:text/GiTAris' /* the background for tetris */
helpfile = 'bbs:text/GiTAris.help' /* help for the game */
/* _main --- master to call the slaves */
main:
call settingsmenu
call init
call clear
call advance
do forever
maygetchar
select
when result = '6' then call rechts /* you may of course change these */
when result = '4' then call links /* keys if you don't like them, */
when result = '2' then call down /* but don't forget to edit the */
when result = '1' then call togglenext /* bbs:text/GiTAris.help file */
when result = '5' then call turn /* if you do change them. */
when result = '8' then call turnback
when result = 'q' then do
call settingsmenu
call init
call clear
end
when result = 'p' then call pause
when result = '9b'x then do
maygetchar
if result = 'A' then
call turn
else
if result = 'B' then
call down
else
if result = 'C' then
call rechts
else
if result = 'D' then
call links
else do
call advance
getcarrier
if result~='TRUE' then call ende
end
end
when result = '1b'x then do
maygetchar
if result = '[' then do
maygetchar
if result = 'A' then
call turn
else
if result = 'B' then
call down
else
if result = 'C' then
call rechts
else
if result = 'D' then
call links
else do
call advance
getcarrier
if result~='TRUE' then call ende
end
end
end
otherwise do
call advance
getcarrier
if result~='TRUE' then call ende
end
end
end
/* _togglenext --- switch the view of next piece on/off */
togglenext:
if naechst=1 then do
call gotoxy(-16,12)
send ' DDDDB DDDDB DDDDB '
naechst=0
end
else do
call gotoxy(-16,12)
send part.nexpiece
naechst=1
end
return
/* _pause --- take a brake and wait for a key */
pause:
result=''
do while result~='p'
maygetchar
end
return
/* _down --- drop the piece right on the floor */
down:
do i=0 to 3
y=akty+i
/* thanks to Tobias 'Top' Walter who helped me to find the bitxor bug */
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)
end
max=akty
do j=akty to 16
px=aktx ; py=j
call passt
if ret=1 then
max=j
else
leave
end
call gotoxy(aktx,akty)
send npart.piece
akty=max
call gotoxy(aktx,akty)
send part.piece
do i=0 to 3
y=akty+i
zeile.y=bitor(zeile.y,right(mask.piece.i,aktx+4,'0'),'0')
end
return
/* _links --- left is reserved, so the move is called by the german word */
links:
do i=0 to 3
y=akty+i
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)
end
px=aktx-1 ; py=akty
call passt
if ret then do
call gotoxy(aktx,akty)
send npart.piece
aktx=aktx-1
call gotoxy(aktx,akty)
send part.piece
end
do i=0 to 3
y=akty+i
zeile.y=bitor(zeile.y,right(mask.piece.i,aktx+4,'0'),'0')
end
return
/* _rechts --- right is reserved, so the move is called by the german word */
rechts:
do i=0 to 3
y=akty+i
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)
end
px=aktx+1 ; py=akty
call passt
if ret then do
call gotoxy(aktx,akty)
send npart.piece
aktx=aktx+1
call gotoxy(aktx,akty)
send part.piece
end
do i=0 to 3
y=akty+i
zeile.y=bitor(zeile.y,right(mask.piece.i,aktx+4,'0'),'0')
end
return
/* _turn --- rotate the piece clockwise */
turn:
do i=0 to 3
y=akty+i
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)
end
altpiece=piece
piece=nextpiece.piece
px=aktx ; py=akty
call passt
if ret then do
call gotoxy(aktx,akty)
send npart.altpiece
call gotoxy(aktx,akty)
send part.piece
end
else
piece=altpiece
do i=0 to 3
y=akty+i
zeile.y=bitor(zeile.y,right(mask.piece.i,aktx+4,'0'),'0')
end
return
/* _turnback --- rotate the piece anti-clockwise */
turnback:
do i=0 to 3
y=akty+i
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)
end
altpiece=piece
piece=prevpiece.piece
px=aktx ; py=akty
call passt
if ret then do
call gotoxy(aktx,akty)
send npart.altpiece
call gotoxy(aktx,akty)
send part.piece
end
else
piece=altpiece
do i=0 to 3
y=akty+i
zeile.y=bitor(zeile.y,right(mask.piece.i,aktx+4,'0'),'0')
end
return
/* _advance --- simply go on one step */
advance:
nochnadvance=1
do while nochnadvance
if piece = 0 then do
if substr(zeile.1,2,10)~='0000000000' then call ende
call grand
piece=nexpiece
nexpiece=randx*numpieces
nexpiece=substr(nexpiece,1,pos('.',nexpiece)-1)
do while nexpiece=0
call randomize
call grand
nexpiece=randx*numpieces
nexpiece=substr(nexpiece,1,pos('.',nexpiece)-1)
end
if naechst then do
call gotoxy(-16,12)
send ' DDDDB DDDDB DDDDB '
call gotoxy(-16,12)
send part.nexpiece
end
aktx = 5 ; akty = 0
end
else
do i=0 to 3
y=akty+i
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)
end
px=aktx ; py=akty+1
call passt
if ret then do
call gotoxy(aktx,akty)
send npart.piece
akty = akty+1
call gotoxy(aktx,akty)
send part.piece
do i=0 to 3
y=akty+i
zeile.y=bitor(zeile.y,right(mask.piece.i,aktx+4,'0'),'0')
end
nochnadvance=0
end
else do
pieces=pieces+1
call gotoxy(-16,8)
send pieces
aufeinmal=0
do i=0 to 3
y=akty+i
zeile.y=bitor(zeile.y,right(mask.piece.i,aktx+4,'0'),'0')
if substr(zeile.y,2,10)='1111111111' & y<16 then do
aufeinmal=aufeinmal+1
j=y+1
do while j>0 & substr(zeile.j,2,10)~='0000000000'
j=j-1
g=j-1
zeile.j=zeile.g
call gotoxy(1,j)
send substr(translate(zeile.j,offchar||onchar,'01'),2,10)
end
lines=lines+1
call gotoxy(-16,6)
send lines
end
end
if zeile.15='10000000000111' then
score = score + 1000 - naechst*500
score = score + aufeinmal*aufeinmal*100 - naechst*aufeinmal*aufeinmal*50
score = score + 2*points.piece - naechst*points.piece
call gotoxy(-16,2)
send score
if score//liftit=0 & score>3000 then do
call grand
newline='1'||right(c2b(d2c(substr(1023*randx,1,pos('.',1023*randx)-1))),10,'0')||'111'
do i=0 to 14
j=i+1
zeile.i=zeile.j
call gotoxy(1,i)
send substr(translate(zeile.i,offchar||onchar,'01'),2,10)
end
zeile.15=newline
call gotoxy(1,15)
send substr(translate(zeile.15,offchar||onchar,'01'),2,10)
end
piece=0
call advance
end
end
return
/* _passt --- checks if a piece fits into the next place */
passt:
ret=1
do i=0 to 3
y=py+i
if bitand(zeile.y,right(mask.piece.i,px+4,'0'),'0')~='00000000000000' then
ret=0
end
return
/* _clear --- rebuild the playfield */
clear:
send '
'
sendfile screen
send '
¢0 p'
do y=0 to 15
zeile.y='10000000000111'
end
do y=16 to 20
zeile.y='11111111111111'
end
if open('scorelist',topfile,'R') then do
highname=readln('scorelist')
highpoints=readln('scorelist')
call close('scorelist')
end
call gotoxy(-16,4)
send highpoints
call gotoxy(-16,2)
send score
piece=0
lines=0
pieces=0
naechst=1
call randomize
call grand
nexpiece=randx*numpieces
if pos('.',nexpiece) >1 then nexpiece=substr(nexpiece,1,pos('.',nexpiece)-1)
do i=0 to 15
call gotoxy(1,i)
send offchar||offchar||offchar||offchar||offchar||offchar||offchar||offchar||offchar||offchar
end
return carrier
/* _gotoxy --- position the cursor inside of the playfield */
gotoxy: procedure
arg x,y
send ''||y+1||';'||x+20||'H'
return
/* _grand --- a better randomroutine than random(). uses a chaosfunction */
/* thanks to Lorenz Stoessel for this routine */
grand:
randx=randr*randx*(1-randx)
return
/* _randomize --- init the random-routine */
randomize:
randx=substr(time(),7,2)/60
randr=substr(time(),4,2)*2/300+3.6
return
/* _displayscore --- show the scores */
displayscore:
send '0c'x
if open('scorelist',topfile,'R') then do
do i=1 to 10
name.i=readln('scorelist')
points.i=readln('scorelist')
end
call close('scorelist')
end
i=1
do while points.i>score & i<11
i=i+1
end
userinfo a ; uname=result
if i=1 & timeback then do
systeminfo q
settime result
send '0c'x
print ''
print ' You are on the first place and have now your full time again!'
print ''
continue
end
if i<11 & uname~=sysopname then do
do j=11 to i+1 by -1
k=j-1
name.j=name.k
points.j=points.k
end
name.i=uname
points.i=score
call open('scorelist',topfile,'W')
do i=1 to 10
call writeln('scorelist',name.i)
call writeln('scorelist',points.i)
end
call close('scorelist')
end
send '0c'x
print ' GiTAris Top Ten! '
print ''
do i=1 to 10
print ' '||right(i,3,' ')||'. -> '||left(name.i,20,' ')||' Score: '||points.i
end
continue
return
/* _exit --- global exit (err & norm) */
ende:
bufferflush
call displayscore
exit
/* _settingsmenu --- display & parse the mainmenu of GiTAris */
settingsmenu:
send '0c'x
userinfo 1 ; xpert=upper(result)
score=0
onchar = '█'
offchar = '│'
cmd=''
do until cmd='N' | cmd='T'
if xpert='NOVICE' then do
sendmenu 'gitarismenu'
call gotoxy(28,10)
send onchar
call gotoxy(28,11)
send offchar
call gotoxy(-19,18)
end
systeminfo m ; time=result
getcmd '[GiTAris - T: '||time||', C: ? + N T S B V H ]' ; cmd=upper(result)
getcarrier
if result~='TRUE' then call ende
select
when cmd='?' then
if xpert~='NOVICE' then do
sendmenu 'gitarismenu'
call gotoxy(28,10)
send onchar
call gotoxy(28,11)
send offchar
call gotoxy(-19,18)
end
when cmd='+' then call ende
when cmd='N' then numpieces=28 /* NUMBER OF NORMAL PIECES */
when cmd='T' then numpieces=48 /* TOTAL NUMBER OF PIECES */
when cmd='S' then call displayscore
when cmd='B' then sendfile helpfile
when cmd='V' then do
if xpert~='NOVICE' then do
sendmenu 'gitarismenu'
call gotoxy(28,10)
send onchar
call gotoxy(28,11)
send offchar
call gotoxy(-19,18)
end
call gotoxy(28,10)
getchar
onchar=result
sendmenu 'gitarismenu'
call gotoxy(28,10)
send onchar
call gotoxy(28,11)
send offchar
call gotoxy(-19,18)
end
when cmd='H' then do
if xpert~='NOVICE' then do
sendmenu 'gitarismenu'
call gotoxy(28,10)
send onchar
call gotoxy(28,11)
send offchar
call gotoxy(-19,18)
end
call gotoxy(28,11)
getchar
offchar=result
sendmenu 'gitarismenu'
call gotoxy(28,10)
send onchar
call gotoxy(28,11)
send offchar
call gotoxy(-19,18)
end
otherwise print "Unknown command, press '?' for menu!"
end
end
return
/* _error, _ioerr, _syntax --- errorhandling... */
ioerr: say 'ioerr '||errortext(rc)||' line '||sigl
syntax: say 'syntax '||errortext(rc)||' line '||sigl
error: say 'error '||errortext(rc)||' line '||sigl
send '0c'x
print 'An error '||errortext(rc)||' in line '||sigl||' hast been detected.'
print 'Please inform SysOp!'
contiune
exit
/* _init --- definition of all tetris pieces */
/* from here to the end is only DATA. look at the end of the script for
instructions how to change the pieces ! */
init:
/*XX..
XX..
....
.... this piece four times to retain statistical equality */
mask.1.0='1100' ; mask.2.0=mask.1.0 ; mask.3.0=mask.1.0 ; mask.4.0=mask.1.0
mask.1.1='1100' ; mask.2.1=mask.1.1 ; mask.3.1=mask.1.1 ; mask.4.1=mask.1.1
mask.1.2='0000' ; mask.2.2=mask.1.2 ; mask.3.2=mask.1.2 ; mask.4.2=mask.1.2
mask.1.3='0000' ; mask.2.3=mask.1.3 ; mask.3.3=mask.1.3 ; mask.4.3=mask.1.3
part.1 = onchar||onchar||'BDD'||onchar||onchar ; part.2=part.1 ; part.3=part.1 ; part.4=part.1
npart.1 = offchar||offchar||'BDD'||offchar||offchar ; npart.2=npart.1 ; npart.3=npart.1 ; npart.4=npart.1
nextpiece.1 = 1 ; nextpiece.2 = 2 ; nextpiece.3 = 3 ; nextpiece.4 = 4
prevpiece.1 = 1 ; prevpiece.2 = 2 ; prevpiece.3 = 3 ; prevpiece.4 = 4
points.1 = 10 ; points.2 = 10 ; points.3 = 10 ; points.4 = 10
/*.X..
.X..
.X..
.X.. this piece two times to retain statistical equality */
mask.5.0='0100' ; mask.6.0=mask.5.0
mask.5.1='0100' ; mask.6.1=mask.5.1
mask.5.2='0100' ; mask.6.2=mask.5.2
mask.5.3='0100' ; mask.6.3=mask.5.3
part.5 = 'C'||onchar||'BD'||onchar||'BD'||onchar||'BD'||onchar ; part.6=part.5
npart.5 = 'C'||offchar||'BD'||offchar||'BD'||offchar||'BD'||offchar ; npart.6=npart.5
nextpiece.5 = 7 ; nextpiece.6 = 8
prevpiece.5 = 7 ; prevpiece.6 = 8
points.5 = 10 ; points.6 = 10
/*....
XXXX
....
....*/
mask.7.0='0000' ; mask.8.0=mask.7.0
mask.7.1='1111' ; mask.8.1=mask.7.1
mask.7.2='0000' ; mask.8.2=mask.7.2
mask.7.3='0000' ; mask.8.3=mask.7.3
part.7 = 'B'||onchar||onchar||onchar||onchar ; part.8=part.7
npart.7 = 'B'||offchar||offchar||offchar||offchar ; npart.8=npart.7
nextpiece.7 = 5 ; nextpiece.8 = 6
prevpiece.7 = 5 ; prevpiece.8 = 6
points.7 = 10 ; points.8 = 10
/*....
XXX.
.X..
....*/
mask.9.0='0000'
mask.9.1='1110'
mask.9.2='0100'
mask.9.3='0000'
part.9 = 'B'||onchar||onchar||onchar||'BDD'||onchar
npart.9 = 'B'||offchar||offchar||offchar||'BDD'||offchar
nextpiece.9 = 10
prevpiece.9 = 12
points.9 = 15
/*.X..
XX..
.X..
....*/
mask.10.0='0100'
mask.10.1='1100'
mask.10.2='0100'
mask.10.3='0000'
part.10 = 'C'||onchar||'DDB'||onchar||onchar||'DB'||onchar
npart.10 = 'C'||offchar||'DDB'||offchar||offchar||'DB'||offchar
nextpiece.10 = 11
prevpiece.10 = 9
points.10 = 15
/*.X..
XXX.
....
....*/
mask.11.0='0100'
mask.11.1='1110'
mask.11.2='0000'
mask.11.3='0000'
part.11 = 'C'||onchar||'DDB'||onchar||onchar||onchar
npart.11 = 'C'||offchar||'DDB'||offchar||offchar||offchar
nextpiece.11 = 12
prevpiece.11 = 10
points.11 = 15
/*.X..
.XX.
.X..
....*/
mask.12.0='0100'
mask.12.1='0110'
mask.12.2='0100'
mask.12.3='0000'
part.12 = 'C'||onchar||'BD'||onchar||onchar||'DDB'||onchar
npart.12 = 'C'||offchar||'BD'||offchar||offchar||'DDB'||offchar
nextpiece.12 = 9
prevpiece.12 = 11
points.12 = 15
/*.X..
.X..
.XX.
....*/
mask.13.0='0100'
mask.13.1='0100'
mask.13.2='0110'
mask.13.3='0000'
part.13 = 'C'||onchar||'BD'||onchar||'BD'||onchar||onchar
npart.13 = 'C'||offchar||'BD'||offchar||'BD'||offchar||offchar
nextpiece.13 = 14
prevpiece.13 = 16
points.13 = 20
/*....
XXX.
X...
....*/
mask.14.0='0000'
mask.14.1='1110'
mask.14.2='1000'
mask.14.3='0000'
part.14 = 'B'||onchar||onchar||onchar||'DDDB'||onchar
npart.14 = 'B'||offchar||offchar||offchar||'DDDB'||offchar
nextpiece.14 = 15
prevpiece.14 = 13
points.14 = 20
/*XX..
.X..
.X..
....*/
mask.15.0='1100'
mask.15.1='0100'
mask.15.2='0100'
mask.15.3='0000'
part.15 = onchar||onchar||'DB'||onchar||'DB'||onchar
npart.15 = offchar||offchar||'DB'||offchar||'DB'||offchar
nextpiece.15 = 16
prevpiece.15 = 14
points.15 = 20
/*..X.
XXX.
....
....*/
mask.16.0='0010'
mask.16.1='1110'
mask.16.2='0000'
mask.16.3='0000'
part.16 = 'CC'||onchar||'DDDB'||onchar||onchar||onchar
npart.16 = 'CC'||offchar||'DDDB'||offchar||offchar||offchar
nextpiece.16 = 13
prevpiece.16 = 15
points.16 = 20
/*.X..
.X..
XX..
....*/
mask.17.0='0100'
mask.17.1='0100'
mask.17.2='1100'
mask.17.3='0000'
part.17 = 'C'||onchar||'DB'||onchar||'DDB'||onchar||onchar
npart.17 = 'C'||offchar||'DB'||offchar||'DDB'||offchar||offchar
nextpiece.17 = 18
prevpiece.17 = 20
points.17 = 20
/*X...
XXX.
....
....*/
mask.18.0='1000'
mask.18.1='1110'
mask.18.2='0000'
mask.18.3='0000'
part.18 = onchar||'DB'||onchar||onchar||onchar
npart.18 = offchar||'DB'||offchar||offchar||offchar
nextpiece.18 = 19
prevpiece.18 = 17
points.18 = 20
/*.XX.
.X..
.X..
....*/
mask.19.0='0110'
mask.19.1='0100'
mask.19.2='0100'
mask.19.3='0000'
part.19 = 'C'||onchar||onchar||'DDB'||onchar||'DB'||onchar
npart.19 = 'C'||offchar||offchar||'DDB'||offchar||'DB'||offchar
nextpiece.19 = 20
prevpiece.19 = 18
points.19 = 20
/*....
XXX.
..X.
....*/
mask.20.0='0000'
mask.20.1='1110'
mask.20.2='0010'
mask.20.3='0000'
part.20 = 'B'||onchar||onchar||onchar||'DB'||onchar
npart.20 = 'B'||offchar||offchar||offchar||'DB'||offchar
nextpiece.20 = 17
prevpiece.20 = 19
points.20 = 20
/*XX..
.XX.
....
.... this piece two times to retain statistical equality */
mask.21.0='1100' ; mask.22.0=mask.21.0
mask.21.1='0110' ; mask.22.1=mask.21.1
mask.21.2='0000' ; mask.22.2=mask.21.2
mask.21.3='0000' ; mask.22.3=mask.21.3
part.21 = onchar||onchar||'DB'||onchar||onchar ; part.22=part.21
npart.21 = offchar||offchar||'DB'||offchar||offchar ; npart.22=npart.21
nextpiece.21 = 23 ; nextpiece.22 = 24
prevpiece.21 = 23 ; prevpiece.22 = 24
points.21 = 20 ; points.22 = 20
/*.X..
XX..
X...
.... this piece two times to retain statistical equality */
mask.23.0='0100' ; mask.24.0=mask.23.0
mask.23.1='1100' ; mask.24.1=mask.23.1
mask.23.2='1000' ; mask.24.2=mask.23.2
mask.23.3='0000' ; mask.24.3=mask.23.3
part.23 = 'C'||onchar||'DDB'||onchar||onchar||'DDB'||onchar ; part.24=part.23
npart.23 = 'C'||offchar||'DDB'||offchar||offchar||'DDB'||offchar ; npart.24=npart.23
nextpiece.23 = 21 ; nextpiece.24 = 22
prevpiece.23 = 21 ; prevpiece.24 = 22
points.23 = 20 ; points.24 = 20
/*.XX.
XX..
....
.... this piece two times to retain statistical equality */
mask.25.0='0110' ; mask.26.0=mask.25.0
mask.25.1='1100' ; mask.26.1=mask.25.1
mask.25.2='0000' ; mask.26.2=mask.25.2
mask.25.3='0000' ; mask.26.3=mask.25.3
part.25 = 'C'||onchar||onchar||'DDDB'||onchar||onchar ; part.26=part.25
npart.25 = 'C'||offchar||offchar||'DDDB'||offchar||offchar ; npart.26=npart.25
nextpiece.25 = 27 ; nextpiece.26 = 28
prevpiece.25 = 27 ; prevpiece.26 = 28
points.25 = 20 ; points.26 = 20
/*X...
XX..
.X..
.... this piece two times to retain statistical equality */
mask.27.0='1000' ; mask.28.0=mask.27.0
mask.27.1='1100' ; mask.28.1=mask.27.1
mask.27.2='0100' ; mask.28.2=mask.27.2
mask.27.3='0000' ; mask.28.3=mask.27.3
part.27 = onchar||'DB'||onchar||onchar||'DB'||onchar ; part.28=part.27
npart.27 = offchar||'DB'||offchar||offchar||'DB'||offchar ; npart.28=npart.27
nextpiece.27 = 25 ; nextpiece.28 = 26
prevpiece.27 = 25 ; prevpiece.28 = 26
points.27 = 20 ; points.28 = 20
/*.X..
....
....
....*/
mask.29.0='0100' ; mask.30.0=mask.29.0 ; mask.31.0=mask.29.0 ; mask.32.0=mask.29.0
mask.29.1='0000' ; mask.30.1=mask.29.1 ; mask.31.1=mask.29.1 ; mask.32.1=mask.29.1
mask.29.2='0000' ; mask.30.2=mask.29.2 ; mask.31.2=mask.29.2 ; mask.32.2=mask.29.2
mask.29.3='0000' ; mask.30.3=mask.29.3 ; mask.31.3=mask.29.3 ; mask.32.3=mask.29.3
part.29 = 'C'||onchar ; part.30=part.29 ; part.31=part.29 ; part.32=part.29
npart.29 = 'C'||offchar ; npart.30=npart.29 ; npart.31=npart.29 ; npart.32=npart.29
nextpiece.29 = 29 ; nextpiece.30 = 30 ; nextpiece.31 = 31 ; nextpiece.32 = 32
prevpiece.29 = 29 ; prevpiece.30 = 30 ; prevpiece.31 = 31 ; prevpiece.32 = 32
points.29 = 5 ; points.30 = 5 ; points.31 = 5 ; points.32 = 5 ;
/*.X..
XXXX
....
....*/
mask.33.0='0100'
mask.33.1='1111'
mask.33.2='0000'
mask.33.3='0000'
part.33 = 'C'||onchar||'DDB'||onchar||onchar||onchar||onchar
npart.33 = 'C'||offchar||'DDB'||offchar||offchar||offchar||offchar
nextpiece.33 = 34
prevpiece.33 = 36
points.33 = 25
/*.X..
.XX.
.X..
.X..*/
mask.34.0='0100'
mask.34.1='0110'
mask.34.2='0100'
mask.34.3='0100'
part.34 = 'C'||onchar||'DB'||onchar||onchar||'DDB'||onchar||'DB'||onchar
npart.34 = 'C'||offchar||'DB'||offchar||offchar||'DDB'||offchar||'DB'||offchar
nextpiece.34 = 35
prevpiece.34 = 33
points.34 = 25
/*....
XXXX
..X.
....*/
mask.35.0='0000'
mask.35.1='1111'
mask.35.2='0010'
mask.35.3='0000'
part.35 = 'B'||onchar||onchar||onchar||onchar||'DDB'||onchar
npart.35 = 'B'||offchar||offchar||offchar||offchar||'DDB'||offchar
nextpiece.35 = 36
prevpiece.35 = 34
points.35 = 25
/*.X..
.X..
XX..
.X..*/
mask.36.0='0100'
mask.36.1='0100'
mask.36.2='1100'
mask.36.3='0100'
part.36 = 'C'||onchar||'DB'||onchar||'DDB'||onchar||onchar||'DB'||onchar
npart.36 = 'C'||offchar||'DB'||offchar||'DDB'||offchar||offchar||'DB'||offchar
nextpiece.36 = 33
prevpiece.36 = 35
points.36 = 25
/*....
X.X.
XXX.
....*/
mask.37.0='0000'
mask.37.1='1010'
mask.37.2='1110'
mask.37.3='0000'
part.37 = 'B'||onchar||'C'||onchar||'DDDB'||onchar||onchar||onchar
npart.37 = 'B'||offchar||'C'||offchar||'DDDB'||offchar||offchar||offchar
nextpiece.37 = 38
prevpiece.37 = 40
points.37 = 25
/*XX..
X...
XX..
....*/
mask.38.0='1100'
mask.38.1='1000'
mask.38.2='1100'
mask.38.3='0000'
part.38 = onchar||onchar||'DDB'||onchar||'DB'||onchar||onchar
npart.38 = offchar||offchar||'DDB'||offchar||'DB'||offchar||offchar
nextpiece.38 = 39
prevpiece.38 = 37
points.38 = 25
/*XXX.
X.X.
....
....*/
mask.39.0='1110'
mask.39.1='1010'
mask.39.2='0000'
mask.39.3='0000'
part.39 = onchar||onchar||onchar||'DDDB'||onchar||'C'||onchar
npart.39 = offchar||offchar||offchar||'DDDB'||offchar||'C'||offchar
nextpiece.39 = 40
prevpiece.39 = 38
points.39 = 25
/*.XX.
..X.
.XX.
....*/
mask.40.0='0110'
mask.40.1='0110'
mask.40.2='0110'
mask.40.3='0110'
part.40 = 'C'||onchar||onchar||'DB'||onchar||'DDB'||onchar||onchar
npart.40 = 'C'||offchar||offchar||'DB'||offchar||'DDB'||offchar||offchar
nextpiece.40 = 37
prevpiece.40 = 39
points.40 = 25
/*.X..
.X..
.X..
....*/
mask.41.0='0100'
mask.41.1='0100'
mask.41.2='0100'
mask.41.3='0000'
part.41 = 'C'||onchar||'DB'||onchar||'DB'||onchar
npart.41 = 'C'||offchar||'DB'||offchar||'DB'||offchar
nextpiece.41 = 41
prevpiece.41 = 48
points.41 = 2
/*..X.
.X..
X...
....*/
mask.42.0='0010'
mask.42.1='0100'
mask.42.2='1000'
mask.42.3='0000'
part.42 = 'CC'||onchar||'DDB'||onchar||'DDB'||onchar
npart.42 = 'CC'||offchar||'DDB'||offchar||'DDB'||offchar
nextpiece.42 = 43
prevpiece.42 = 41
points.42 = 2
/*....
XXX.
....
....*/
mask.43.0='0000'
mask.43.1='1110'
mask.43.2='0000'
mask.43.3='0000'
part.43 = 'B'||onchar||onchar||onchar
npart.43 = 'B'||offchar||offchar||offchar
nextpiece.43 = 44
prevpiece.43 = 42
points.43 = 2
/*X...
.X..
..X.
....*/
mask.44.0='1000'
mask.44.1='0100'
mask.44.2='0010'
mask.44.3='0000'
part.44 = onchar||'B'||onchar||'B'||onchar
npart.44 = offchar||'B'||offchar||'B'||offchar
nextpiece.44 = 45
prevpiece.44 = 43
points.44 = 2
/*.X..
.X..
.X..
....*/
mask.45.0='0100'
mask.45.1='0100'
mask.45.2='0100'
mask.45.3='0000'
part.45 = 'C'||onchar||'DB'||onchar||'DB'||onchar
npart.45 = 'C'||offchar||'DB'||offchar||'DB'||offchar
nextpiece.45 = 46
prevpiece.45 = 44
points.45 = 2
/*..X.
.X..
X...
....*/
mask.46.0='0010'
mask.46.1='0100'
mask.46.2='1000'
mask.46.3='0000'
part.46 = 'CC'||onchar||'DDB'||onchar||'DDB'||onchar
npart.46 = 'CC'||offchar||'DDB'||offchar||'DDB'||offchar
nextpiece.46 = 47
prevpiece.46 = 45
points.46 = 2
/*....
XXX.
....
....*/
mask.47.0='0000'
mask.47.1='1110'
mask.47.2='0000'
mask.47.3='0000'
part.47 = 'B'||onchar||onchar||onchar
npart.47 = 'B'||offchar||offchar||offchar
nextpiece.47 = 48
prevpiece.47 = 46
points.47 = 2
/*X...
.X..
..X.
....*/
mask.48.0='1000'
mask.48.1='0100'
mask.48.2='0010'
mask.48.3='0000'
part.48 = onchar||'B'||onchar||'B'||onchar
npart.48 = offchar||'B'||offchar||'B'||offchar
nextpiece.48 = 41
prevpiece.48 = 47
points.48 = 2
return
/*****************************************************************************/
/* YEAH! This is the end!!!!
How about designing some more pieces?
all you need:
- a field of 4 4-byte strings containing the shape of it
so, all pieces up to
XXXX
XXXX
XXXX
XXXX
are possible.
- create a 'part' string with the ansicodes to display the piece
- create a 'npart' string with the ansicodes to delete the piece
- set the pointers to the 'nextpiece' when turning clockwise
and to the 'prevpiece' when turning anti-clockwise
- define the amount of points, the player will get when dropping
this piece
- ADJUST the "numpieces" Variable in 'settingsmenu:'
*/