{$cleq} /* ©iF */


    /*****************************************************************************
     *                                                                           *
     *  XProfan-Schach, a XProfan OpenSource Project, started march 2005         *
     *                  Copyright (C) 2004 by iF (if@mxii.com)                   *
     *___________________________________________________________________________*
     *                                                                           *
     *  This program is free software; you can redistribute it and/or            *
     *  modify it under the terms of the GNU General Public License              *
     *  as published by the Free Software Foundation; either version 1.1         *
     *  of the License, or (at your option) any later version.                   *
     *                                                                           *
     *  This program is distributed in the hope that it will be useful,          *
     *  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
     *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            *
     *  GNU General Public License for more details.                             *
     *                                                                           *
     *  You should have received a copy of the GNU General Public License        *
     *  along with this program; if not, write to the Free Software              *
     *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-        *
     *  1307, USA.                                                               *
     *___________________________________________________________________________*
     *                                                                           *
     *  Source started by: [20050627] [IF] [if@mxii.com]                    0.1  *
     *  Source changed by: [DATE] [NICK/NAME] [EML] [CHANGES]                    *
     *                                                                           *
     *****************************************************************************/
     
     
$U Thread.Pcu = Thread.

/* decl globz */        declare apptitle$,ex%,mhovx%,mhovy%,mx%,my%,board$,mark%,setted%,ntpx%,ntpy%,i&,gmx%,gmy%,gmp#,doNothing%,lk%,boardhist&,s$,statbar&
                        declare col.black&,col.white&,col.text&,col.board&,invcol%,board_figAllowedMove$,actPlayer%

Dim gmp#,8

apptitle$:="XProfan Schach, Beta 0.1.iF-Remake"

windowstyle 512+2+8+16
windowtitle apptitle$
window %maxx,%maxy - %maxx,%maxy

/* setchessboard */     board$:="TPSDKSPTBBBBBBBB                                bbbbbbbbtpsdkspt"
                        board_figAllowedMove$:=mkstr$(" ",64)
/* setniceicon */       external("user32","SetClassLongA",%hwnd,-14,external("shell32","ExtractIconA",%Hinstance,"shell32.dll",160))
/* popupmenugen */      makepopupmenu
/* setinnersize 432 */  external("user32","SetWindowPos",%hwnd,0,%Winleft,%Wintop,((%Winright-%Winleft)-(Width(%hwnd)-432)),((%Winbottom-%Wintop)-(Height(%hwnd)-432)),0)
/* statusbargen */      makestatbar
/* centerwindow */      external("user32","SetWindowPos",%hwnd,0,((%maxx/2)-((%winright-%winleft)/2)),((%maxy/2)-((%winbottom-%wintop)/2)),(%winright-%winleft),(%winbottom-%wintop),0)
/* paintBoard */        setboardcolors;paintboard
/* boarHistoryTrick*/   boardHist&:=createlistbox(%hwnd,"",0,0,0,0);showwindow(boardHist&,0);pushHist

whilenot ex%

        thread.start 1
        waitinput
        thread.stop 1
        
        if %menuitem
        
                mx%:=%menuitem
                setmenuitem 0
                
                if mx%=102
                
                        ex%+
                        
                elseif mx%==100
                
                        newGameWhite
                        
                elseif mx%==101
                
                        newGameBlack
                        
                elseif mx%==103
                
                        historyBack
                        
                elseif mx%==104
                
                        col.black&:=getcolor(col.black&)
                        paintBoard
                        
                elseif mx%==105
                
                        col.white&:=getcolor(col.white&)
                        paintBoard
                        
                elseif mx%==106
                
                        col.board&:=getcolor(col.board&)
                        paintBoard
                        
                elseif mx%==107
                
                        col.text&:=getcolor(col.text&)
                        paintBoard
                        
                elseif mx%==108
                
                        setBoardColors
                        paintBoard
                        
                elseif mx%==109
                
                        s$:=loadfile$("Lade neues Figuren-Set","Grafiken|*.bmp|")
                        
                        if len(s$)
                        
                                if fileexists(s$)
                                
                                        mloadbmp s$
                                        paintBoard
                                        
                                endif
                                
                        endif
                        
                        
                elseif mx%==110
                                
                        messagebox "XProfan-Schach 0.1.iF-Remake\n© 2005 iF",apptitle$,64
                        
                elseif mx%==111
                
                        invcol%:=if(invcol%,0,1)
                        redrawOnlyFigures
                        writeWhoCanMove

                endif
                
                mx%:=0
                
        elseif not(doNothing%)
        
                if %mousekey==1

                        mx%:=gmx%;my%:=gmy%

                        if (mx%>16) and (mx%<416) and (my%>16) and (my%<416)

                                if mark%

                                        ifnot setted%

                                                if mid$(board$,mark%,1)<>" "
                                                
                                                        if isOpponent(if(actplayer%,0,1),mark%)

                                                                setted%:=mark%

                                                                markFigure mark%

                                                                ifnot figCanMove()

                                                                        deMarkFigure setted%

                                                                        setted%:=0
                                                                        mark%:=0
                                                                        mhovx%:=0
                                                                        mhovy%:=0

                                                                endif
                                                                
                                                        endif

                                                endif

                                        else

                                                if mark%==setted%

                                                        deMarkFigure setted%
                
                                                else

                                                        if mid$(board_figAllowedMove$,mark%,1)=="X"
                                                        
                                                                moveFigure setted%,mark%
                                                                togglePlayer
                                                
                                                        else
                                                        
                                                                killFigShowPossMoves
                                                                drawboardfield setted%,0
                                                                dispFigure setted%
                                                                removeFieldHov
                                                        
                                                        endif

                                                endif

                                                setted%:=0
                                                mark%:=0
                                                mhovx%:=0
                                                mhovy%:=0

                                        endif

                                endif

                        endif

                endif
        
        endif
        
        case %key==2 : ex%+
        
wend

dispose gmp#

end

                                        /* Functions */
                                        
proc togglePlayer

        actPlayer%=if(actPlayer%,0,1)
        
        writeWhoCanMove
        
endproc

proc writeWhoCanMove

        settext statbar&,1,if(actPlayer%,if(invcol%,"Weiß am Zug","Schwarz am Zug"),if(invcol%,"Schwarz am Zug","Weiß am Zug"))

endproc

proc ntp // num to pos

        parameters n&
        
        declare on&
        
        n&-
        
        on&:=n&
        
        n&:=n&/8
        
        ntpy%:=n&
        ntpx%:=(on&-ntpy%*8)
        
        ntpy%+
        ntpx%+
        
        ntpx%=(ntpx%-1)*50+16
        ntpy%=(ntpy%-1)*50+16
        
endproc


                                        
proc ntpt // num to pt

        parameters n&
        
        declare on&
        
        n&-
        
        on&:=n&
        
        n&:=n&/8
        
        ntpy%:=n&
        ntpx%:=(on&-ntpy%*8)
        
        ntpy%+
        ntpx%+
                
endproc
        
proc figCanMove

        case instr("X",board_figAllowedMove$) : return 1
        
        return 0

endproc
                                        
proc moveFigure

        parameters f&,t&
        
        declare c$
        
        c$:=mid$(board$,f&,1)
        
        setBoardMem f&," "
        setBoardMem t&,c$
        
        drawboardfield f&,0
        dispFigure f&
        
        drawboardfield t&,0
        dispFigure t&
        
        mark%:=0
        setted%:=0
        
        copybmptomem ntpx%,ntpy% - 50,50 > 300,50
        
        pushHist
        
        killFigShowPossMoves

endproc

proc killFigShowPossMoves

        declare c&
        
        board_figAllowedMove$:=mkstr$(" ",64)

        for c&:=1 to 64 do begin

                if mid$(board$,c&,1)==" "
                        
                        drawBoardField c&,0
                        
                else
                
                        dispFigure c&
                        
                endif

        end

endproc

proc redrawOnlyFigures

        declare c&

        for c&:=1 to 64 do begin

                ifnot mid$(board$,c&,1)==" "
                
                        dispFigure c&
                        
                endif

        end

endproc

proc pushHist

        addstring(boardHist&,board$)
        
endproc

proc historyBack

        declare c&
        
        c&:=getcount(boardHist&)-1
        
        if c&
        
                deletestring(boardHist&,c&)
                
                board$:=getstring$(boardHist&,c&-1)
                
                paintFigures
                togglePlayer
                
        else
        
                messagebox "Kein Zug zum zurücknehmen vorhanden.",apptitle$,4096
        
        endif
        
endproc

proc paintFigures

        declare c&

        for c&:=1 to 64 do begin

                drawBoardField c&,0
                dispFigure c&

        end

endproc

proc setBoardMem

        parameters f&,c1$
        
        board$:=ins$(c1$,del$(board$,f&,1),f&)
        
endproc

proc setAllowedMove

        parameters f&
        
        board_figAllowedMove$:=ins$("X",del$(board_figAllowedMove$,f&,1),f&)
        
endproc

proc markFigure

        parameters f&
        
        copybmptomem (mhovx%-1)*50+16,(mhovy%-1)*50+16 - 50,50 > 300,50
        mcopybmp 300,0 - 50,50 > (((mhovx%-1)*50)+16),(((mhovy%-1)*50)+16);-1
        
        dispFigurePossibleMovs f&,if(upper$(mid$(board$,f&,1))==mid$(board$,f&,1),1,0)
        
endproc

proc dispFigurePossibleMovs

        parameters f&,op%
        
        declare c$,figCanStack$,i&
        
        c$:=upper$(mid$(board$,f&,1))
        
        figCanStack$:=""
        
        if c$=="B"
        
                ifnot op%

                        if isOnBoard(f&,0,-1)

                                if isPlaceFree(f&-8)

                                        figCanStack$:=figCanStack$+"^"  

                                        if f&>48

                                                if isPlaceFree(f&-16)

                                                        figCanStack$:=figCanStack$+"|^^"

                                                endif

                                        endif

                                endif

                        endif

                        if isOnBoard(f&,-1,-1)

                                case isOpponent(op%,f&-9) : figCanStack$:=figCanStack$+"|^<"

                        endif

                        if isOnBoard(f&,1,-1)

                                case isOpponent(op%,f&-7) : figCanStack$:=figCanStack$+"|^>"

                        endif
                        
                else
                
                        if isOnBoard(f&,0,1)

                                if isPlaceFree(f&+8)

                                        figCanStack$:=figCanStack$+"_"  

                                        if f&<16

                                                if isPlaceFree(f&+16)

                                                        figCanStack$:=figCanStack$+"|__"

                                                endif

                                        endif

                                endif

                        endif

                        if isOnBoard(f&,-1,+1)

                                case isOpponent(op%,f&+7) : figCanStack$:=figCanStack$+"|_<"

                        endif

                        if isOnBoard(f&,1,+1)

                                case isOpponent(op%,f&+9) : figCanStack$:=figCanStack$+"|_>"

                        endif           
                        
                endif
                
        elseif c$=="T"
        
                for i&:=1 to 8 do begin
                
                        if isOnBoard(f&,i&,0)
                        
                                if isOpponent(op%,f&+i&)

                                        figCanStack$:=figCanStack$+mkstr$(">",i&)+"|"
                                
                                endif

                                if isPlaceFree(f&+i&)

                                        figCanStack$:=figCanStack$+mkstr$(">",i&)+"|"
                                        
                                else
                                
                                        break

                                endif
                                                                
                        endif
                
                end

                for i&:=1 to 8 do begin
                
                        if isOnBoard(f&,0,i&)
                        
                                if isOpponent(op%,f&+i&*8)

                                        figCanStack$:=figCanStack$+mkstr$("_",i&)+"|"
                                
                                endif

                                if isPlaceFree(f&+i&*8)

                                        figCanStack$:=figCanStack$+mkstr$("_",i&)+"|"
                                        
                                else
                                
                                        break

                                endif
                                                                
                        endif
                
                end

                for i&:=1 to 8 do begin
                
                        if isOnBoard(f&,i&*-1,0)
                        
                                if isOpponent(op%,f&+i&*-1)

                                        figCanStack$:=figCanStack$+mkstr$("<",i&)+"|"
                                
                                endif

                                if isPlaceFree(f&+i&*-1)

                                        figCanStack$:=figCanStack$+mkstr$("<",i&)+"|"
                                        
                                else
                                
                                        break

                                endif
                                                                
                        endif
                
                end
        
                for i&:=1 to 8 do begin
                
                        if isOnBoard(f&,0,i&*-1)
                        
                                if isOpponent(op%,f&+i&*-8)

                                        figCanStack$:=figCanStack$+mkstr$("^",i&)+"|"
                                
                                endif

                                if isPlaceFree(f&+i&*-8)

                                        figCanStack$:=figCanStack$+mkstr$("^",i&)+"|"
                                        
                                else
                                
                                        break

                                endif
                                                                
                        endif
                
                end
        

        elseif c$=="S"
        
                for i&:=1 to 8 do begin
                
                        if isOnBoard(f&,i&,i&)
                        
                                if isOpponent(op%,f&+i&+i&*8)

                                        figCanStack$:=figCanStack$+mkstr$(">_",i&)+"|"
                                
                                endif

                                if isPlaceFree(f&+i&+i&*8)

                                        figCanStack$:=figCanStack$+mkstr$(">_",i&)+"|"
                                        
                                else
                                
                                        break

                                endif
                                                                
                        endif
                
                end

                for i&:=1 to 8 do begin
                
                        if isOnBoard(f&,i&*-1,i&)
                        
                                if isOpponent(op%,f&+i&*8-i&)

                                        figCanStack$:=figCanStack$+mkstr$("_<",i&)+"|"
                                
                                endif

                                if isPlaceFree(f&+i&*8-i&)

                                        figCanStack$:=figCanStack$+mkstr$("_<",i&)+"|"
                                        
                                else
                                
                                        break

                                endif
                                                                
                        endif
                
                end

                for i&:=1 to 8 do begin
                
                        if isOnBoard(f&,i&*-1,i&*-1)
                        
                                if isOpponent(op%,f&+i&*-1+i&*-8)

                                        figCanStack$:=figCanStack$+mkstr$("<^",i&)+"|"
                                
                                endif

                                if isPlaceFree(f&+i&*-1+i&*-8)

                                        figCanStack$:=figCanStack$+mkstr$("<^",i&)+"|"
                                        
                                else
                                
                                        break

                                endif
                                                                
                        endif
                
                end
        
                for i&:=1 to 8 do begin
                
                        if isOnBoard(f&,i&,i&*-1)
                        
                                if isOpponent(op%,f&+i&*-8+i&)

                                        figCanStack$:=figCanStack$+mkstr$("^>",i&)+"|"
                                
                                endif

                                if isPlaceFree(f&+i&*-8+i&)

                                        figCanStack$:=figCanStack$+mkstr$("^>",i&)+"|"
                                        
                                else
                                
                                        break

                                endif
                                                                
                        endif
                
                end
                
        elseif c$=="P" // horsePower ^^
        
                if isOnBoard(f&,1,-2)
                
                        case isOpponentOrFree(op%,f&+1-16) : figCanStack$:=figCanStack$+">^^|"
                                
                endif
        
                if isOnBoard(f&,-1,-2)
                
                        case isOpponentOrFree(op%,f&-1-16) : figCanStack$:=figCanStack$+"<^^|"
                                
                endif
        
                if isOnBoard(f&,1,2)
                
                        case isOpponentOrFree(op%,f&+2+16) : figCanStack$:=figCanStack$+">__|"
                                
                endif
        
                if isOnBoard(f&,-1,2)
                
                        case isOpponentOrFree(op%,f&-1+16) : figCanStack$:=figCanStack$+"<__|"
                                
                endif
        
                if isOnBoard(f&,2,-1)
                
                        case isOpponentOrFree(op%,f&+2-8) : figCanStack$:=figCanStack$+">>^|"
                                
                endif
        
                if isOnBoard(f&,-2,-1)
                
                        case isOpponentOrFree(op%,f&-2-8) : figCanStack$:=figCanStack$+"<<^|"
                                
                endif
        
                if isOnBoard(f&,2,1)
                
                        case isOpponentOrFree(op%,f&+2+8) : figCanStack$:=figCanStack$+">>_|"
                                
                endif
        
                if isOnBoard(f&,-2,1)
                
                        case isOpponentOrFree(op%,f&-2+8) : figCanStack$:=figCanStack$+"<<_|"
                                
                endif
        
        elseif c$=="K"
        
                case isOnBoard(f&,-1, 0) : case isOpponentOrFree(op%,f&-1) : figCanStack$:=figCanStack$+"<|"
                case isOnBoard(f&, 1, 0) : case isOpponentOrFree(op%,f&+1) : figCanStack$:=figCanStack$+">|"
                case isOnBoard(f&, 0,-1) : case isOpponentOrFree(op%,f&-8) : figCanStack$:=figCanStack$+"^|"
                case isOnBoard(f&, 0, 1) : case isOpponentOrFree(op%,f&+8) : figCanStack$:=figCanStack$+"_|"
                case isOnBoard(f&,-1,-1) : case isOpponentOrFree(op%,f&-9) : figCanStack$:=figCanStack$+"<^|"
                case isOnBoard(f&, 1,-1) : case isOpponentOrFree(op%,f&-7) : figCanStack$:=figCanStack$+">^|"
                case isOnBoard(f&, 1, 1) : case isOpponentOrFree(op%,f&+9) : figCanStack$:=figCanStack$+"_>|"
                case isOnBoard(f&,-1, 1) : case isOpponentOrFree(op%,f&+7) : figCanStack$:=figCanStack$+"_<|"
        
        elseif c$=="D"
        
        
                for i&:=1 to 8 do begin
                
                        if isOnBoard(f&,i&,i&)
                        
                                if isOpponent(op%,f&+i&+i&*8)

                                        figCanStack$:=figCanStack$+mkstr$(">_",i&)+"|"
                                
                                endif

                                if isPlaceFree(f&+i&+i&*8)

                                        figCanStack$:=figCanStack$+mkstr$(">_",i&)+"|"
                                        
                                else
                                
                                        break

                                endif
                                                                
                        endif
                
                end

                for i&:=1 to 8 do begin
                
                        if isOnBoard(f&,i&*-1,i&)
                        
                                if isOpponent(op%,f&+i&*8-i&)

                                        figCanStack$:=figCanStack$+mkstr$("_<",i&)+"|"
                                
                                endif

                                if isPlaceFree(f&+i&*8-i&)

                                        figCanStack$:=figCanStack$+mkstr$("_<",i&)+"|"
                                        
                                else
                                
                                        break

                                endif
                                                                
                        endif
                
                end

                for i&:=1 to 8 do begin
                
                        if isOnBoard(f&,i&*-1,i&*-1)
                        
                                if isOpponent(op%,f&+i&*-1+i&*-8)

                                        figCanStack$:=figCanStack$+mkstr$("<^",i&)+"|"
                                
                                endif

                                if isPlaceFree(f&+i&*-1+i&*-8)

                                        figCanStack$:=figCanStack$+mkstr$("<^",i&)+"|"
                                        
                                else
                                
                                        break

                                endif
                                                                
                        endif
                
                end
        
                for i&:=1 to 8 do begin
                
                        if isOnBoard(f&,i&,i&*-1)
                        
                                if isOpponent(op%,f&+i&*-8+i&)

                                        figCanStack$:=figCanStack$+mkstr$("^>",i&)+"|"
                                
                                endif

                                if isPlaceFree(f&+i&*-8+i&)

                                        figCanStack$:=figCanStack$+mkstr$("^>",i&)+"|"
                                        
                                else
                                
                                        break

                                endif
                                                                
                        endif
                
                end
        
                for i&:=1 to 8 do begin
                
                        if isOnBoard(f&,i&,0)
                        
                                if isOpponent(op%,f&+i&)

                                        figCanStack$:=figCanStack$+mkstr$(">",i&)+"|"
                                
                                endif

                                if isPlaceFree(f&+i&)

                                        figCanStack$:=figCanStack$+mkstr$(">",i&)+"|"
                                        
                                else
                                
                                        break

                                endif
                                                                
                        endif
                
                end

                for i&:=1 to 8 do begin
                
                        if isOnBoard(f&,0,i&)
                        
                                if isOpponent(op%,f&+i&*8)

                                        figCanStack$:=figCanStack$+mkstr$("_",i&)+"|"
                                
                                endif

                                if isPlaceFree(f&+i&*8)

                                        figCanStack$:=figCanStack$+mkstr$("_",i&)+"|"
                                        
                                else
                                
                                        break

                                endif
                                                                
                        endif
                
                end

                for i&:=1 to 8 do begin
                
                        if isOnBoard(f&,i&*-1,0)
                        
                                if isOpponent(op%,f&+i&*-1)

                                        figCanStack$:=figCanStack$+mkstr$("<",i&)+"|"
                                
                                endif

                                if isPlaceFree(f&+i&*-1)

                                        figCanStack$:=figCanStack$+mkstr$("<",i&)+"|"
                                        
                                else
                                
                                        break

                                endif
                                                                
                        endif
                
                end
        
                for i&:=1 to 8 do begin
                
                        if isOnBoard(f&,0,i&*-1)
                        
                                if isOpponent(op%,f&+i&*-8)

                                        figCanStack$:=figCanStack$+mkstr$("^",i&)+"|"
                                
                                endif

                                if isPlaceFree(f&+i&*-8)

                                        figCanStack$:=figCanStack$+mkstr$("^",i&)+"|"
                                        
                                else
                                
                                        break

                                endif
                                                                
                        endif
                
                end
        
        
        endif
        
        dispFigCanStack f&,figCanStack$

endproc

proc halt

        end
        
endproc

proc isOnBoard

        parameters f&,movx%,movy%
        
        declare of&
        
        case f&<1 : return 0
        case f&>64 : return 0
        
        of&:=f&
        
        ntpt f&
        
        ntpx%:=ntpx%+movx%
        ntpy%:=ntpy%+movy%
        
        case (ntpx%<1) or (ntpx%>8) : return 0
        case (ntpy%<1) or (ntpy%>8) : return 0
        
        return 1
        
endproc

proc isOpponentOrFree

        parameters op%,f&
        
        case ((isOpponent(op%,f&)) or (isPlaceFree(f&))) : return 1
        
        return 0
        
endproc

proc isOpponent

        parameters op%,f&
        
        case mid$(board$,f&,1)==" " : return 0
        
        if upper$(mid$(board$,f&,1))==mid$(board$,f&,1)
        
                f&:=if(op%,0,1)
        
        else
        
                f&:=if(op%,1,0)
                
        endif
        
        return f&
        
endproc


proc isPlaceFree

        parameters f&
        
        case mid$(board$,f&,1)==" " : return 1

        return 0
        
endproc

proc dispFigCanStack

        parameters f&,s$
        
        declare c$,of&
        
        of&:=f&
        
        while len(s$)
        
                c$:=mid$(s$,1,1)
                s$:=del$(s$,1,1)
                
                if c$=="|"
                
                        if of&<>f&
                                
                                setAllowedMove f&
                                drawBoardField f&,1
                                        
                        endif           
                        
                        f&:=of&
                
                endif
                
                case c$=="^" : f&:=f&-8
                case c$=="<" : f&:=f&-1
                case c$==">" : f&:=f&+1
                case c$=="_" : f&:=f&+8
                
        wend
        
        if of&<>f&
        
                setAllowedMove f&
                drawBoardField f&,1
                
        endif           
        
endproc

proc deMarkFigure

        parameters f&
        
        drawBoardField f&,0
        
        dispFigure f&
        
        copybmptomem ntpx%,ntpy% - 50,50 > 300,50
        
        killFigShowPossMoves
        
endproc

proc drawBoardField

        parameters f&,m%
        
        ifnot m%
        
                usepen 5,0,0

                f&-

                if not(f& mod 2)

                        if (f& mod 16)>7

                                usebrush 1,col.black&;else;usebrush 1,col.white&

                        endif

                else

                        ifnot (f& mod 16)>7

                                usebrush 1,col.black&;else;usebrush 1,col.white&

                        endif

                endif
                
        
                f&+

                ntp f&

                rectangle ntpx%,ntpy% - ntpx%+51,ntpy%+51

        else
        
                ntp f&
                
                usepen 0,0,0
                usebrush 1,rgb(255,0,0)
                ellipse ntpx%+23,ntpy%+23 - ntpx%+27,ntpy%+27
                usepen 5,0,0
                ellipse ntpx%+25,ntpy%+25 - ntpx%+25,ntpy%+25

        endif
        
                
endproc
                                        
proc paintboard

        declare x&,y&,tgl%
                
        /* load Sprites */
                
        deflate.figurenbmp      
        mloadbmp "figuren.bmp"
        assign #1,"figuren.bmp"
        erase #1
        
        /* Paint Board */
        
        cls col.board&
        usepen 5,0,0
        usebrush 1,col.black&
        rectangle 16,16 - 417,417
        usebrush 1,col.white&
        
        tgl%:=1
        
        for y&:=0 to 7 do begin
        
                for x&:=0 to 7 do begin
                
                        if tgl%
                        
                                tgl%:=0
                                rectangle x&*50+16,y&*50+16 - x&*50+67,y&*50+67
                                
                        else
                        
                                tgl%:=1
                                
                        endif
                        
                        dispFigure (y&*8+x&+1),x&*50+16,y&*50+16
                        
                end
                
                if tgl%;tgl%:=0;else;tgl%:=1
                endif
                
        end
        
        /* Paint Bordetexts */
                
        usefont "MS Sans Serif",12,0,0,0,0
        textcolor col.text&,-1

        decimals 0
        
        for x&:=0 to 7 do begin
        
                drawtext x&*50+40,2,chr$(97+x&)
                drawtext x&*50+40,418,chr$(97+x&)
                drawtext 4,x&*50+36,str$(8-x&)
                drawtext 420,x&*50+36,str$(8-x&)
                
        end

        mark%:=0

endproc

proc dispFigure

        parameters f&
        
        declare c$,xp%,yp%
        
        ntp f&
        
        c$:=mid$(board$,f&,1)
        
        case c$=" " : return 
        
        if upper$(c$)==c$;yp%:=if(invcol%,0,50);else;yp%:=if(invcol%,50,0)
        endif
                
        c$:=upper$(c$)
        
        if      c$=="K";xp%:=0;
        elseif  c$=="D";xp%:=50;
        elseif  c$=="P";xp%:=100;
        elseif  c$=="S";xp%:=150;
        elseif  c$=="T";xp%:=200;
        elseif  c$=="B";xp%:=250;
        endif
        
        mcopybmp xp%,yp% - 50,50 > ntpx%-1,ntpy%;-1
        
endproc
        
proc makestatbar

        declare m#
        dim m#,12
        long m#,0=50,150,width(%hwnd)
        statbar&:=create("statuswindow",%hwnd,"Bereit.",3,m#)
        dispose m#
        
        setwindowpos %hwnd=%winleft,%wintop - (%winright-%winleft),(%winbottom-%wintop)+height(statbar&)+2;0
        external("user32","SetWindowPos",statbar&,0,0,0,0,0,0)
        
        writeWhoCanMove
        
endproc

proc makepopupmenu

        popup "&Spiel"
        
        Subpopup "Neues Spiel"
        Appendmenu 100,"Mensch spielt mit Weiss"
        Appendmenu 101,"Mensch spielt mit Schwarz"
        endsub
        Appendmenu 102,"Profan-Schach beenden"
        popup "&Züge"
        Appendmenu 103,"Zug zurücknehmen"
        popup "&Einstellungen"
        Appendmenu 104,"Farbe der schwarzen Felder"
        Appendmenu 105,"Farbe der weissen Felder"
        Appendmenu 106,"Farbe des Rahmens"
        Appendmenu 107,"Farbe des Texts im Rahmen"
        Appendmenu 108,"Ursprungsfarben wieder herstellen"
        Appendmenu 109,"Andere Spielfiguren laden"
        separator
        
        Appendmenu 111,"Figuren tauschen"
        
        popup "&Infos"
        Appendmenu 110,"Über"   
        
endproc

proc thread.do

        if getactivewindow()<>%hwnd
        
                doNothing%:=1
                return
                
        endif
                
        /* Gimmi-Perfect-Local-Mousepos */
        
        clear gmp#
        external("user32","ClientToScreen",%hwnd,gmp#)
        gmx%=long(gmp#,0)
        gmy%=long(gmp#,4)
        external("user32","GetCursorPos",gmp#)
        gmx%=long(gmp#,0)-gmx%
        gmy%=long(gmp#,4)-gmy%  
        
        /* EO Gimmi-Perfect-Local-Mousepos */
        
        // casenot len(gettext$(external("user32","WindowFromPoint",long(gmp#,0),long(gmp#,4)))) : return

        mx%:=gmx%;my%:=gmy%
        
        lk%:=if(external("user32","GetAsyncKeyState",1)==0,0,1)
        
        if (mx%>16) and (mx%<416) and (my%>16) and (my%<416)
        
                mx%:=(mx%-16)/50+1
                my%:=(my%-16)/50+1
        
                if doNothing%
                
                        if lk%
                        
                                doNothing%:=0
                                
                                while if(external("user32","GetAsyncKeyState",1)==0,0,1)
                                
                                        sleep 10
                                        
                                wend
                                
                                return
                                
                        endif
                        
                endif
                
                ifnot doNothing%

                        if (mhovx%<>mx%) or (mhovy%<>my%)

                                case (mhovx%+mhovy%>0) : removeFieldHov

                                mhovx%:=mx%;mhovy%:=my%

                                dispFieldHov

                        endif
                        
                endif
                
        else
        
                if lk%
                
                        doNothing%:=1
                        thread.stop 1
                        
                endif
                
                ifnot doNothing%
        
                        if mhovx%+mhovy%>0

                                removeFieldHov

                                mhovx%:=0;mhovy%:=0

                        endif
                        
                endif
        
        endif
        
        

        
endproc

proc removeFieldHov

        mcopybmp 300,50 - 50,50 > (mhovx%-1)*50+16,(mhovy%-1)*50+16 ;0

endproc

proc dispFieldHov

        copybmptomem (mhovx%-1)*50+16,(mhovy%-1)*50+16 - 50,50 > 300,50
        mcopybmp 300,0 - 50,50 > (((mhovx%-1)*50)+16),(((mhovy%-1)*50)+16);-1
                
        mark%:=(mhovy%-1)*8+(mhovx%)

endproc

proc getcolor 

        parameters pre&
        
        declare c&,choosecolor#,customcolors#

        dim choosecolor#,36;dim customcolors#,64;clear choosecolor#,customcolors#
        
        long choosecolor#,0=36,%hwnd,0,pre&,customcolors#,3,0,0,0
        external("comdlg32","ChooseColorA",choosecolor#);c&=long(choosecolor#,12) 

        dispose choosecolor#;dispose customcolors# 

        return c& 

endproc 

proc setboardcolors

        col.black&:=    rgb(080,200,080) 
        col.white&:=    rgb(124,255,124)
        col.text&:=     rgb(160,160,160)
        col.board&:=    rgb(0,0,0)
        
endproc

proc newGameWhite

        destroywindow(boardHist&)
        board$:="TPSDKSPTBBBBBBBB                                bbbbbbbbtpsdkspt"
        boardHist&:=createlistbox(%hwnd,"",0,0,0,0);showwindow(boardHist&,0);pushHist
        invcol%:=0
        actplayer%:=0
        paintFigures
        writeWhoCanMove
        
endproc
        
proc newGameBlack

        destroywindow(boardHist&)
        board$:="TPSDKSPTBBBBBBBB                                bbbbbbbbtpsdkspt"
        boardHist&:=createlistbox(%hwnd,"",0,0,0,0);showwindow(boardHist&,0);pushHist
        invcol%:=1
        actplayer%:=0
        paintFigures
        writeWhoCanMove
        
endproc

proc deflate.figurenbmp

        Declare mem#

        ifnot fileexists("figuren.bmp")

                Dim mem#,17724
                Clear mem#
                Long mem#,0=1161186626,0,7733248,2621440,22937600,6553600,65536,4,1153433600,185794560,185794560,1048576,0,0,0,-2147483520,-2147483648,8388736,8388608,-2139094912,-1061158912,-2139094848,128,-16776961,-16777216,16711935,16711680
                Long mem#,108=-65281,-65536,-572718849,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307
                Long mem#,188=-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307
                Long mem#,268=208,0,0,0,0,0,-572719091,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307
                Long mem#,364=-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307
                Long mem#,444=-256,-1,-1,-1,-1,-1,-572719104,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307
                Long mem#,540=-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307
                Long mem#,620=-241,-1,-1,-1,-1,-1,-572718864,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307
                Long mem#,716=-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307
                Long mem#,796=65295,0,0,0,0,-16777216,-572718864,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307
                Long mem#,888=-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307
                Long mem#,968=-572662307,-586289137,-572662307,-572662307,-572662307,-572662307,265346525,-572718864,-572662307,14540253,0,-587202560,-572662307,-572662307,-572662307,-572662307,0,0,-572662307,-572662307,-572662307,-572662307
                Long mem#,1056=0,0,0,-586350592,-572662307,-586297123,-572662307,-572662307,-572662307,-586297123,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307
                Long mem#,1144=-572662307,-572657649,-572662307,-572662307,-572662307,-572662307,266198493,-572718864,-572662307,53469,0,0,-572662515,-572662307,-572662307,13688285,0,0,-572715776,-572662307,-572662307,-572662307,0,0,0,-586350592
                Long mem#,1248=-572662307,221,0,14540032,0,-587202560,-572662307,14540253,0,0,0,-587202560,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572657649,-572662307,-572662307,-572662307,-572662307,266198493
                Long mem#,1348=-572718864,-572662307,0,0,0,-572719104,-572662307,-572662307,221,0,0,-587202560,-572662307,-572662307,-572662307,0,0,251658240,-586350337,-572662307,221,0,13634816,0,-587202560,-572662307,14540253,0,0,0,-587202560
                Long mem#,1472=-572662307,-572662307,221,0,0,-586350592,-572662307,-572657649,-572662307,-572662307,-572662307,-572662307,266198493,-572718864,-572662307,16715728,0,-16777216,-572715536,-572662307,-572662307,-15740707,0,0,-586288897
                Long mem#,1572=-572662307,-572662307,-572662307,0,0,251658240,-586350337,-572662307,208,0,0,0,218103808,-572662307,14540253,0,0,0,-587202560,-572662307,-572662307,221,0,0,-586350592,-572662307,-572657649,-572662307,-572662307
                Long mem#,1688=-572662307,-572662307,266198493,-572718864,-572662307,-61488,-1,-1,-572715536,-572662307,-572662307,-16723747,-1,-1,-586350337,-572662307,-572662307,-572662307,0,0,251658240,-586350337,-572662307,208,0,0,0,218103808
                Long mem#,1800=-572662307,14540253,0,0,0,-587202560,-572662307,-572662307,221,0,0,-586350592,-572662307,-572657649,-572662307,-572662307,-572662307,-572662307,266198493,-572718864,-572662307,-16776995,-1,16777215,-572662528,-572662307
                Long mem#,1904=-572662307,56797,-1,-1,-572719104,-572662307,-572662307,-572662307,208,0,251658240,-586350337,-572662307,53469,0,-267390961,0,-586350592,-572662307,14540253,-61696,-1,-1,-587202320,-572662307,-572662307,221,0,0
                Long mem#,2020=-586350592,-572662307,-572657649,-572662307,-572662307,-572662307,-572662307,266198493,-572718864,-572662307,221,0,0,-572662528,-572662307,-572662307,56797,0,0,-572719104,-572662307,-572662307,-572662307,208,0
                Long mem#,2120=251658240,-586350337,-572662307,-572662307,-572662307,1044480,-572662307,-572662307,-572662307,14540253,-61696,-1,-1,-587202320,-572662307,-572662307,221,0,0,-586350592,-572662307,-572657649,-572662307,-572662307
                Long mem#,2216=-572662307,-572662307,266198493,-572718864,-572662307,16711901,0,-16777216,-572662528,-572662307,-572662307,-16720419,0,0,-572718849,-572662307,-572662307,-572662307,221,0,251658240,-586350337,-572662307,-572662307
                Long mem#,2312=14540253,0,-572662515,-572662307,-572662307,-572662307,221,0,0,-572662528,-572662307,-572662307,221,0,0,-586350592,-572662307,-572657649,-572662307,-572662307,-572662307,-572662307,266198493,-572718864,-572662307
                Long mem#,2412=-65315,-1,-1,-572662528,-572662307,-572662307,-16720419,-1,-1,-572718849,-572662307,-572662307,-572662307,53469,0,251658240,-586350337,-572662307,-572662307,53469,0,-586350592,-572662307,-572662307,-572662307,221
                Long mem#,2516=0,0,-572662528,-572662307,-572662307,221,0,0,-586350592,-572662307,-572657649,-572662307,-572662307,-572662307,-572662307,266198493,-572718864,-572662307,-16776995,-1,16777215,-572662528,-572662307,-572662307,56797
                Long mem#,2616=-1,-1,-572719104,-572662307,-572662307,-586297123,56797,0,251658240,-586350337,-572662307,-572662307,53469,0,-586350592,-572662307,-572662307,-572662307,221,0,0,-572662528,-572662307,-572662307,53469,0,0,-572719104
                Long mem#,2728=-572662307,-572657649,-572662307,-572662307,-572662307,-572662307,266198493,-572718864,-572662307,208,0,0,-572715776,-572662307,-572662307,53469,0,0,-586350592,-572662307,-572662307,-587202560,13688285,0,251658240
                Long mem#,2828=-586350337,-572662307,-572662307,-16723747,-1,-586350337,-572662307,-572662307,-572662307,-65315,-1,-1,-572662528,-572662307,-572662307,53469,0,0,-572719104,-572662307,-572657649,-572662307,-572662307,-572662307
                Long mem#,2924=-572662307,266198493,-572718864,-572662307,208,0,0,-572715776,-572662307,-572662307,-15740707,0,0,-586288897,-572662307,-790766115,218103808,14540253,0,251658240,-572718849,-572662307,-572662307,-16720419,-1,-572718849
                Long mem#,3028=-572662307,-572662307,-572662307,-15793955,-1,-251658241,-572662528,-572662307,-572662307,53469,0,0,-572719104,-572662307,-572657649,-572662307,-572662307,-572662307,-572662307,266198493,-572718864,-572662307,16715520
                Long mem#,3120=0,-16777216,-572718864,-572662307,-572662307,-15793955,-1,-1,-587140865,-572662307,14540253,15732480,14540253,0,251658240,-572718849,-572662307,-572662307,56797,0,-572719104,-572662307,-572662307,-572662307,53469
                Long mem#,3220=0,0,-572662515,-572662307,-572662307,56797,0,0,-572715776,-572662307,-572657649,-572662307,-572662307,-572662307,-572662307,266198493,-572718864,-790766115,-256,267452415,-1,-586350337,-572662307,-572662307,251658461
                Long mem#,3320=-1,-1,-587202560,-572662307,13688285,15728640,-790766323,0,251658240,-572718849,-572662307,-572662307,13688285,0,-572715776,-572662307,-572662307,-572662307,56797,0,0,-572662307,-572662307,-572662307,56797,0,0
                Long mem#,3428=-572715776,-572662307,-572657649,-572662307,-572662307,-572662307,-572662307,266198493,-572718864,14540253,-16715761,267452415,16777215,-587141105,-572662307,-572662307,208,0,0,218103808,-572662307,13688285,255
                Long mem#,3520=-572662528,0,251658240,-572718864,-572662307,-572662307,265346525,0,-572715536,-572662307,-572662307,-572662307,265346525,-1,233897983,-572662307,-572662307,-572662307,13688285,0,0,-572662528,-572662307,-572657649
                Long mem#,3616=-572662307,-572662307,-572662307,-572662307,266198493,-572718864,13688285,255,267390720,240,218169088,-572662307,-572662307,0,0,0,0,-572662307,13688285,61695,-572719104,0,-16777216,-572718864,-572662307,-572662307
                Long mem#,3720=265346525,-1,-572715536,-572662307,-572662307,-572662307,14540253,-1,-587137025,-572662307,-572662307,-572662307,14540253,0,0,-572662515,-572662307,-572657649,-572662307,-572662307,-572662307,-572662307,266198493
                Long mem#,3812=-572718864,251715037,240,267390720,240,15732480,-572662307,-572662307,0,0,0,0,-572662307,13688285,61455,-587202560,208,-16777216,-572715536,-572662307,-572662307,56797,-1,-572719104,-572662307,-572662307,-572662307
                Long mem#,3920=14540253,0,-587202560,-572662307,-572662307,-572662307,-790766115,0,0,-572662307,-572662307,-572657649,-572662307,-572662307,-572662307,-572662307,266198493,-572718864,-16720419,0,267390720,240,16711680,-572662307
                Long mem#,4016=-572662307,0,0,0,0,-572662307,13688285,0,0,208,-16777216,-572715536,-572662307,-572662307,53469,0,-586350592,-572662307,-572662307,-572662307,14540253,0,-587202560,-572662307,-572662307,-572662307,-572662307,0
                Long mem#,4128=218103808,-572662307,-572662307,-572657649,-572662307,-572662307,-572662307,-572662307,266198493,-572718864,-267398947,0,267390720,240,-267452416,-572662515,-572662307,0,0,0,0,-572662307,14540253,0,0,0,-16777216
                Long mem#,4236=-572715776,-572662307,-572662307,53469,0,-586350592,-572662307,-572662307,-572662307,14540253,0,-587202560,-572662307,-572662307,-572662307,-572662307,221,-586350592,-572662307,-572662307,-572657649,-572662307
                Long mem#,4324=-572662307,-572662307,-572662307,266198493,-572718864,-267398947,0,65280,255,-267452416,-572662515,-572662307,0,0,0,0,-572662307,14540253,0,0,0,-15794176,-572662528,-572662307,-572662307,221,0,-587202560,-572662307
                Long mem#,4440=-572662307,-572662307,14540253,0,-587202560,-572662307,-572662307,-572662307,-572662307,208,-587202560,-572662307,-572662307,-572657649,-572662307,-572662307,-572662307,-572662307,266198493,-572718864,-267398947
                Long mem#,4524=0,65280,255,-267452416,-572662515,-572662307,851968,0,0,53248,-572662307,-790766115,0,0,0,-15794176,-572662528,-572662307,-572662307,221,15732480,-587202560,-572662307,-572662307,-572662307,14540253,0,-587202560
                Long mem#,4636=-572662307,-572662307,-572662307,-572662307,0,218103808,-572662307,-572662307,-572657649,-572662307,-572662307,-572662307,-572662307,266198493,-572718864,-267398947,0,-267390961,61455,-267452416,-572662515,-790766115
                Long mem#,4724=14483456,13631488,3328,56576,-572662515,-790766115,0,0,61455,-267452416,-572662528,-572662307,-572662307,208,15732480,218103808,-572662307,-572662307,-572662307,14540253,0,-587202560,-572662307,-572662307,-572662307
                Long mem#,4824=-572662307,0,0,-572662307,-572662307,-572657649,-572662307,-572662307,-572662307,-572662307,266198493,-572718864,-267398947,0,-267452161,65280,-267452416,-572662515,-790766115,14483456,13631488,3328,56576,-572662515
                Long mem#,4920=-572662307,0,0,61455,-251723776,-572662515,-572662307,-572662307,208,15732480,218103808,-572662307,-572662307,-572662307,14540253,0,-587202560,-572662307,-572662307,-572662307,-790766115,0,0,-572662307,-572662307
                Long mem#,5020=-572657649,-572662307,-572662307,-572662307,-572662307,266198493,-572718864,-16720419,-16777216,-65296,16715520,16711680,-572662307,-790766115,14486784,13634816,13634816,13688064,-572662515,-572662307,0,0,65280
                Long mem#,5112=16711680,-572662515,-572662307,-572662307,208,-1,218103808,-572662307,-572662307,-572662307,14540253,0,-587202560,-572662307,-572662307,-572662307,-790766115,0,0,-572662307,-572662307,-572657649,-572662307,-572662307
                Long mem#,5208=-572662307,-572662307,266198493,-572718864,251715037,-1,267386880,-65536,15794175,-572662307,-790766115,14486784,13634816,13634816,13688064,-572662515,-572662307,208,0,65280,16715520,-572662307,-572662307,-572662307
                Long mem#,5304=208,-1,218103808,-572662307,-572662307,-572662307,14540253,0,-587202560,-572662307,-572662307,-572662307,-790766115,0,0,-572662307,-572662307,-572657649,-572662307,-572662307,-572662307,-572662307,266198493,-572718864
                Long mem#,5400=13688285,16777215,267390720,-16776976,218169343,-572662307,-790766115,14540032,14486784,13688064,14540032,-572662515,-572662307,208,0,65280,15732480,-572662307,-572662307,-572662307,208,15732480,218103808,-572662307
                Long mem#,5496=-572662307,-572662307,14540253,0,-587202560,-572662307,-572662307,-572662307,-790766115,0,0,-572662307,-572662307,-572657649,-572662307,-572662307,-572662307,-572662307,266198493,-572718864,14540253,0,267390928
                Long mem#,5588=3568,-587202560,-572662307,-790766115,14540032,14540032,14540032,14540032,-572662515,-572662307,-267452195,0,0,233897728,-572662307,-572662307,-572662307,221,15732480,-587202560,-572662307,-572662307,-572662307
                Long mem#,5680=14540253,-1,-587137025,-572662307,-572662307,-572662307,-572662307,0,218103808,-572662307,-572662307,-572657649,-572662307,-572662307,-572662307,-572662307,266198493,-572718864,-572662307,-587202560,267390928,14487024
                Long mem#,5768=-572719104,-572662307,14540253,14540045,14540032,14540032,-790766336,-572662528,-572662307,-15793955,240,0,218169088,-572662307,-572662307,-572662307,221,15732480,-587202560,-572662307,-572662307,-572662307,251715037
                Long mem#,5860=-1,15794175,-572662307,-572662307,-572662307,-572662307,0,218103808,-572662307,-572662307,-572657649,-572662307,-572662307,-572662307,-572662307,266198493,-572718864,-572662307,-572662307,-61488,-572715536,-572662307
                Long mem#,5948=-572662307,14540253,14540045,14540032,14540032,-790766336,-572662528,-572662307,-16723747,240,0,-587141105,-572662307,-572662307,-572662307,53469,0,-586350592,-572662307,-572662307,-572662307,53469,0,0,-572662515
                Long mem#,6048=-572662307,-572662307,-572662307,208,-587202560,-572662307,-572662307,-572657649,-572662307,-572662307,-572662307,-572662307,266198493,-572718864,-572662307,-572662307,-65315,-572662528,-572662307,-572662307,14540253
                Long mem#,6132=14540253,14540045,-790766336,-572662528,-572662528,-572662307,251711709,255,0,-586288897,-572662307,-572662307,-572662307,56797,0,-572719104,-572662307,-572662307,-572662307,221,0,0,-572662528,-572662307,-572662307
                Long mem#,6232=-572662307,221,-586350592,-572662307,-572662307,-572657649,-572662307,-572662307,-572662307,-572662307,266198493,-572718864,-572662307,-572662307,221,-572662528,-572662307,-572662307,13688285,14540253,14540045
                Long mem#,6316=-790766336,-572662528,-572715776,-572662307,56797,0,251658240,-586350337,-572662307,-572662307,-572662307,13688285,0,-572715776,-572662307,-572662307,-572662307,-61488,-1,-1,-572715536,-572662307,-572662307,-572662307
                Long mem#,6412=56797,-572715776,-572662307,-572662307,-572657649,-572662307,-572662307,-572662307,-572662307,266198493,-572718864,-572662307,-572662307,56797,-572662307,-572662307,-572662307,56797,14540253,-790766323,-790766323
                Long mem#,6496=-572662528,-572719104,-572662307,56797,0,-16777216,-572718864,-572662307,-572662307,-572662307,14540253,0,-572662528,-572662307,-572662307,-572662307,-61488,-1,-1,-572715536,-572662307,-572662307,-572662307,56797
                Long mem#,6592=-572715776,-572662307,-572662307,-572657649,-572662307,-572662307,-572662307,-572662307,266198493,-572718864,-572662307,-572662307,231792093,-572662307,-572662307,-572662307,53469,14540045,-790766115,-572662515
                Long mem#,6672=-790766336,-586350592,-572662307,13688285,65295,-65536,-572715776,-572662307,-572662307,-572662307,-790766115,0,-572662515,-572662307,-572662307,-572662307,208,0,0,-572715776,-572662307,-572662307,-572662307,53469
                Long mem#,6768=-572719104,-572662307,-572662307,-572657649,-572662307,-572662307,-572662307,-572662307,266198493,-572718864,-572662307,-572662307,231792093,-572662307,-572662307,-572662307,53469,14540045,-790766115,-572662515
                Long mem#,6848=-790766336,-586350592,-572662307,13688285,61440,16776960,-572662528,-572662307,-572662307,-572662307,-572662307,218104016,-572662307,-572662307,-572662307,-572662307,208,0,0,-572715776,-572662307,-572662307,-572662307
                Long mem#,6940=53469,-572719104,-572662307,-572662307,-572657649,-572662307,-572662307,-572662307,-572662307,266198493,-572718864,-572662307,-572662307,231792093,-572662307,-572662307,-572662307,56797,14540253,-790766115,-572662515
                Long mem#,7024=-572662528,-572719104,-572662307,13688285,0,61440,-572662307,-572662307,-572662307,-572662307,-572662307,-587202339,-572662307,-572662307,-572662307,-572662307,208,0,0,-572715776,-572662307,-572662307,-572662307
                Long mem#,7116=53469,-572719104,-572662307,-572662307,-572657649,-572662307,-572662307,-572662307,-572662307,266198493,-572718864,-572662307,-572662307,231792093,-572662307,-572662307,-572662307,231792093,13688285,-790766323
                Long mem#,7196=-790766323,-572715776,-572715568,-572662307,13688285,0,-587202560,-572662307,-572662307,-572662307,-572662307,-572662307,-587202339,-572662307,-572662307,-572662307,-572662307,208,0,0,-572715776,-572662307,-572662307
                Long mem#,7288=-572662307,53469,-572719104,-572662307,-572662307,-572657649,-572662307,-572662307,-572662307,-572662307,266198493,-572718864,-572662307,-572662307,221,-572662528,-572662307,-572662307,-572662307,56797,14540032
                Long mem#,7372=14540032,-572719104,-572662307,-572662307,13688285,3328,-572662528,-572662307,-572662307,-572662307,-572662307,-572662307,218104016,-572662307,-572662307,-572662307,-572662307,218104016,53469,13688077,-572715776
                Long mem#,7456=-572662307,-572662307,-572662307,56797,-572715776,-572662307,-572662307,-572657649,-572662307,-572662307,-572662307,-572662307,266198493,-572718864,-572662307,-572662307,221,-572662528,-572662307,-572662307,-572662307
                Long mem#,7540=56797,13688064,14486784,-572719104,-572662307,-572662307,13688285,56576,-572662515,-572662307,-572662307,-572662307,-572662307,-572662307,218104016,-572662307,-572662307,-572662307,-572662307,218104016,53469,13688077
                Long mem#,7628=-572715776,-572662307,-572662307,-572662307,56797,-572715776,-572662307,-572662307,-572657649,-572662307,-572662307,-572662307,-572662307,266198493,-572718864,-572662307,-572662307,231792093,-572662307,-572662307
                Long mem#,7708=-572662307,-572662307,13688285,13688077,-790819584,-572715776,-572662307,-572662307,13688285,56589,-572662515,-572662307,-572662307,-572662307,-572662307,-572662307,218104016,-572662307,-572662307,-572662307,-572662307
                Long mem#,7792=218104016,53469,13688077,-572715776,-572662307,-572662307,-572662307,14540253,-572662515,-572662307,-572662307,-572657649,-572662307,-572662307,-572662307,-572662307,266198493,-572718864,-572662307,-572662307,231792093
                Long mem#,7876=-572662307,-572662307,-572662307,-572662307,14540253,14540253,-572662528,-572662528,-572662307,-572662307,56797,13688285,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-587202339,-572662307,-572662307
                Long mem#,7960=-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572657649,-572662307,-572662307,-572662307,-572662307,266198493,-572718864
                Long mem#,8040=-572662307,-572662307,231792093,-572662307,-572662307,-572662307,-572662307,-572662307,-790766115,-572662515,-572662307,-572662307,-572662307,-587145763,232644061,-572662307,-572662307,-572662307,-572662307,-572662307
                Long mem#,8120=-572662307,-586297123,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-586289137,-572662307,-572662307
                Long mem#,8200=-572662307,-572662307,265346525,-572718864,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307
                Long mem#,8280=-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307
                Long mem#,8360=-572662307,65295,0,0,0,0,-16777216,-572718864,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307
                Long mem#,8452=-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307
                Long mem#,8532=-572662307,-572662307,-241,-1,-1,-1,-1,-1,-572718864,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307
                Long mem#,8628=-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307
                Long mem#,8708=-572662307,-572662307,-256,-1,-1,-1,-1,-1,-572719104,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307
                Long mem#,8804=-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307
                Long mem#,8884=-572662307,-572662307,208,0,0,0,0,0,-572719091,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307
                Long mem#,8980=-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307
                Long mem#,9060=-572662307,-572662307,208,0,0,0,0,0,-572719091,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307
                Long mem#,9156=-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307
                Long mem#,9236=-572662307,-572662307,-256,-1,-1,-1,-1,-1,-572719104,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307
                Long mem#,9332=-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307
                Long mem#,9412=-572662307,-572662307,-241,-1,-1,-1,-1,-1,-572718864,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307
                Long mem#,9508=-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307
                Long mem#,9588=-572662307,-572662307,65295,0,0,0,0,-16777216,-572718864,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307
                Long mem#,9680=-572662307,-572662307,-572662307,-572662307,-572662307,-586297123,-572662307,-572662307,-572662307,-586297123,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307
                Long mem#,9760=-572662307,-572662307,-572662307,-586289137,-572662307,-572662307,-572662307,-572662307,265346525,-572718864,-572662307,14540253,0,-587202560,-572662307,-572662307,-572662307,-572662307,0,0,-572662307,-572662307
                Long mem#,9848=-572662307,-572662307,208,0,0,-587202560,-572662307,221,0,-572662307,0,-587202560,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307
                Long mem#,9944=-572662307,-572657649,-572662307,-572662307,-572662307,-572662307,266198493,-572718864,-572662307,53469,0,0,-572662515,-572662307,-572662307,13688285,0,0,-572715776,-572662307,-572662307,-572662307,208,0,0,-587202560
                Long mem#,10048=-572662307,221,0,14540032,0,-587202560,-572662307,14540253,0,0,0,-586350592,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572657649,-572662307,-572662307,-572662307,-572662307,266198493
                Long mem#,10148=-572718864,-572662307,251658240,-1,16777215,-572719104,-572662307,-572662307,221,-1,-1,-587202320,-572662307,-572662307,-572662307,-61488,-1,-1,-587140865,-572662307,-61488,-1,13634816,-1,233897983,-572662307
                Long mem#,10252=14540253,0,0,0,-586350592,-572662307,-572662307,221,0,0,-587202560,-572662307,-572657649,-572662307,-572662307,-572662307,-572662307,266198493,-572718864,-572662307,251658448,-1,16777215,-572715776,-572662307
                Long mem#,10352=-572662307,53469,-1,-1,-586350352,-572662307,-572662307,-572662307,-61488,-1,-1,-587140865,-572662307,208,251658240,-16776961,240,218103808,-572662307,14540253,-1,-1,-1,-586288897,-572662307,-572662307,221,0,0
                Long mem#,10468=-587202560,-572662307,-572657649,-572662307,-572662307,-572662307,-572662307,266198493,-572718864,-572662307,208,0,0,-572715776,-572662307,-572662307,53469,0,0,-586350592,-572662307,-572662307,-572662307,-61488
                Long mem#,10564=-1,-1,-587140865,-572662307,0,0,-267390961,0,0,-572662307,14540253,0,0,0,-586350592,-572662307,-572662307,-65315,-1,-1,-587137025,-572662307,-572657649,-572662307,-572662307,-572662307,-572662307,266198493,-572718864
                Long mem#,10680=-572662307,16711901,0,-16777216,-572662528,-572662307,-572662307,-16720419,240,0,-572718849,-572662307,-572662307,-572662307,-65315,-1,-1,-587140865,-572662307,-572662307,-790766115,1044480,-572662515,-572662307
                Long mem#,10776=-572662307,14540253,0,0,0,-586350592,-572662307,-572662307,-65315,-1,-1,-587137025,-572662307,-572657649,-572662307,-572662307,-572662307,-572662307,266198493,-572718864,-572662307,-65315,-1,-1,-572662528,-572662307
                Long mem#,10880=-572662307,-16720419,-1,-1,-572718849,-572662307,-572662307,-572662307,-15793955,-1,-1,-587140865,-572662307,-572662307,-572662307,0,-572662307,-572662307,-572662307,-572662307,-61488,-1,-1,-572662528,-572662307
                Long mem#,10980=-572662307,-65315,-1,-1,-587137025,-572662307,-572657649,-572662307,-572662307,-572662307,-572662307,266198493,-572718864,-572662307,-16776995,-1,16777215,-572662528,-572662307,-572662307,56797,-241,-1,-572719104
                Long mem#,11076=-572662307,-572662307,-572662307,-16723747,-1,-1,-587140865,-572662307,-572662307,14540253,0,-572662528,-572662307,-572662307,-572662307,-61488,-1,-1,-572662528,-572662307,-572662307,-65315,-1,-1,-587137025,-572662307
                Long mem#,11180=-572657649,-572662307,-572662307,-572662307,-572662307,266198493,-572718864,-572662307,221,0,0,-572662528,-572662307,-572662307,56797,0,0,-572719104,-572662307,-572662307,-587145763,-16720419,-1,-1,-587140865
                Long mem#,11280=-572662307,-572662307,53469,0,-586350592,-572662307,-572662307,-572662307,-61488,-1,-1,-572662528,-572662307,-572662307,-65315,-1,-1,-587137025,-572662307,-572657649,-572662307,-572662307,-572662307,-572662307
                Long mem#,11376=266198493,-572718864,-572662307,16711901,0,-16777216,-572662528,-572662307,-572662307,-16720419,240,0,-572718849,-572662307,-572662307,218104016,265346525,-1,-1,-587140865,-572662307,-572662307,251711709,-1,-586350352
                Long mem#,11476=-572662307,-572662307,-572662307,208,0,0,-572662528,-572662307,-572662307,-15740707,-1,-1,-586288897,-572662307,-572657649,-572662307,-572662307,-572662307,-572662307,266198493,-572718864,-572662307,-61488,-1
                Long mem#,11572=-1,-572715536,-572662307,-572662307,-15740707,-1,-1,-586288897,-572662307,-572662307,16711680,14540253,-1,-1,-587140865,-572662307,-572662307,53469,-1,-586350592,-572662307,-572662307,-572662307,208,0,0,-572662528
                Long mem#,11680=-572662307,-572662307,-15740707,-1,-1,-586288897,-572662307,-572657649,-572662307,-572662307,-572662307,-572662307,266198493,-572718864,-572662307,-61488,-1,-1,-572715536,-572662307,-572662307,53469,-1,-1,-586350592
                Long mem#,11780=-572662307,-790766115,1044495,-790766115,-241,-1,-586288897,-572662307,-572662307,56797,0,-572719104,-572662307,-572662307,-572662307,-15793955,-1,16777215,-572662515,-572662307,-572662307,-15740707,-1,-1,-586288897
                Long mem#,11880=-572662307,-572657649,-572662307,-572662307,-572662307,-572662307,266198493,-572718864,-572662307,-16777216,-1,16777215,-572719104,-572662307,-572662307,221,0,0,-587202560,-572662307,14540253,-267386881,-790766323
                Long mem#,11972=-256,-1,-586288897,-572662307,-572662307,-16720419,0,-572718849,-572662307,-572662307,-572662307,-16723747,-1,15794175,-572662307,-572662307,-572662307,-16720419,-1,-1,-572718849,-572662307,-572657649,-572662307
                Long mem#,12068=-572662307,-572662307,-572662307,266198493,-572718864,-790766115,61440,0,0,-586350577,-572662307,-572662307,-65315,0,0,-587137025,-572662307,14540253,-251658256,-572662528,-61696,-1,-586288897,-572662307,-572662307
                Long mem#,12168=265346525,-1,-572715536,-572662307,-572662307,-572662307,56797,0,218103808,-572662307,-572662307,-572662307,-16720419,-1,-1,-572718849,-572662307,-572657649,-572662307,-572662307,-572662307,-572662307,266198493
                Long mem#,12260=-572718864,14540253,16776975,0,-16777216,-587140865,-572662307,-572662307,-16773168,-1,-1,233894143,-572662307,14540253,-61456,-572715776,-61488,-1,-586350337,-572662307,-572662307,13688285,-1,-572715776,-572662307
                Long mem#,12360=-572662307,-572662307,13688285,0,-587202560,-572662307,-572662307,-572662307,265346525,-1,-1,-572715536,-572662307,-572657649,-572662307,-572662307,-572662307,-572662307,266198493,-572718864,13688285,-1,267452415
                Long mem#,12452=-1,218169343,-572662307,-572662307,0,-241,-1,0,-572662307,14540253,-61456,-586350337,-65328,-1,-586350337,-572662307,-572662307,13688285,0,-572715776,-572662307,-572662307,-572662307,265346525,-1,-587137025,-572662307
                Long mem#,12560=-572662307,-572662307,14540253,-1,-1,-572662528,-572662307,-572657649,-572662307,-572662307,-572662307,-572662307,266198493,-572718864,251715037,-1,267452415,-1,15794175,-572662307,-572662307,15732480,251658240
                Long mem#,12652=240,15728640,-572662307,14540253,-61441,218165503,-65315,-1,-572718849,-572662307,-572662307,56797,0,-572719104,-572662307,-572662307,-572662307,265346525,-1,-587137025,-572662307,-572662307,-572662307,-790766115
                Long mem#,12748=-256,16777215,-572662515,-572662307,-572657649,-572662307,-572662307,-572662307,-572662307,266198493,-572718864,-16720419,-1,267452415,-1,16777215,-572662307,-572662307,65280,240,251658240,16711680,-572662307
                Long mem#,12840=-790766115,-241,15794175,-65523,-1,-572718849,-572662307,-572662307,-16723747,-1,-586350337,-572662307,-572662307,-572662307,265346525,-1,-587137025,-572662307,-572662307,-572662307,-572662307,-61696,15794175
                Long mem#,12932=-572662307,-572662307,-572657649,-572662307,-572662307,-572662307,-572662307,266198493,-572718864,-15740707,-1,267452415,-1,-251658241,-572662515,-572662307,65280,-268369921,-65521,983040,-572662307,-790766115
                Long mem#,13020=-241,-251658241,-65536,-1,-572718864,-572662307,-572662307,-15740707,-1,-586288897,-572662307,-572662307,-572662307,265346525,-1,-587137025,-572662307,-572662307,-572662307,-572662307,-65315,-587137025,-572662307
                Long mem#,13112=-572662307,-572657649,-572662307,-572662307,-572662307,-572662307,266198493,-572718864,-15740707,-1,65535,-1,-251658241,-572662515,-572662307,913408,-16715521,-15793921,1036288,-572662307,-572662307,-256,-1,-65536
                Long mem#,13208=-1,-572715536,-572662307,-572662307,-65315,-1,-587137025,-572662307,-572662307,-572662307,265346525,-1,-587137025,-572662307,-572662307,-572662307,-572662307,-65328,218169343,-572662307,-572662307,-572657649,-572662307
                Long mem#,13300=-572662307,-572662307,-572662307,266198493,-572718864,-15740707,-1,65535,-1,-251658241,-572662515,-572662307,913408,-16715521,-15793921,-268382208,-572662307,-572662307,-256,-1,-65296,-1,-572715536,-572662307
                Long mem#,13396=-572662307,-65315,-15732481,-587137025,-572662307,-572662307,-572662307,265346525,-1,-587137025,-572662307,-572662307,-572662307,-572662307,-61696,15794175,-572662307,-572662307,-572657649,-572662307,-572662307
                Long mem#,13480=-572662307,-572662307,266198493,-572718864,-15740707,-1,-267390721,-241,-251658241,-572662515,-790766115,14483471,265289983,-16773648,-268378880,-572662515,-572662307,-61488,-1,-65281,-1,-572715776,-572662307
                Long mem#,13572=-572662307,-61488,-15732481,233897983,-572662307,-572662307,-572662307,265346525,-1,-587137025,-572662307,-572662307,-572662307,-572662307,-256,16777215,-572662307,-572662307,-572657649,-572662307,-572662307,-572662307
                Long mem#,13660=-572662307,266198493,-572718864,-15740707,-1,-267390721,-256,-251658241,-572662515,-790766115,14483456,265289983,-16773648,56576,-572662515,-572662307,-61488,-1,-65281,-1,-572662528,-572662307,-572662307,-61488
                Long mem#,13756=-15732481,233897983,-572662307,-572662307,-572662307,265346525,-1,-587137025,-572662307,-572662307,-572662307,-790766115,-241,-251658241,-572662515,-572662307,-572657649,-572662307,-572662307,-572662307,-572662307
                Long mem#,13840=266198493,-572718864,-16720419,-1,-65281,-61696,16777215,-572662307,-790766115,14486784,265293296,265293296,13688064,-572662515,-572662307,-65315,-1,-15732481,-251658241,-572662528,-572662307,-572662307,-61488
                Long mem#,13932=0,233897983,-572662307,-572662307,-572662307,265346525,-1,-587137025,-572662307,-572662307,-572662307,-790766115,-241,-251658241,-572662515,-572662307,-572657649,-572662307,-572662307,-572662307,-572662307,266198493
                Long mem#,14020=-572718864,251715037,-1,-65536,-65536,15794175,-572662307,-790766115,14486784,265293296,265293296,13688064,-572662515,-572662307,-65315,-1,-15732481,-251658241,-572662515,-572662307,-572662307,-61488,0,233897983
                Long mem#,14116=-572662307,-572662307,-572662307,265346525,-1,-587137025,-572662307,-572662307,-572662307,-790766115,-241,-251658241,-572662515,-572662307,-572657649,-572662307,-572662307,-572662307,-572662307,266198493,-572718864
                Long mem#,14200=13688285,16777215,-61696,-16776976,218169343,-572662307,-790766115,14540032,265293296,265293296,14540032,-572662515,-572662307,268370141,-1,-15732481,16777215,-572662515,-572662307,-572662307,-61488,-15732481
                Long mem#,14288=233897983,-572662307,-572662307,-572662307,265346525,-1,-587137025,-572662307,-572662307,-572662307,-790766115,-241,-251658241,-572662515,-572662307,-572657649,-572662307,-572662307,-572662307,-572662307,266198493
                Long mem#,14372=-572718864,14540253,0,-61488,3568,-587202560,-572662307,-790766115,14540032,14540032,14540032,14540032,-572662515,-572662307,1036509,-241,-1,16777215,-572662307,-572662307,-572662307,-65315,-15732481,-587137025
                Long mem#,14468=-572662307,-572662307,-572662307,13688285,0,-587202560,-572662307,-572662307,-572662307,-572662307,-256,16777215,-572662307,-572662307,-572657649,-572662307,-572662307,-572662307,-572662307,266198493,-572718864
                Long mem#,14552=-572662307,-587202560,-61488,14487024,-572719104,-572662307,14540253,14540045,14540032,14540032,-790766336,-572662528,-572662307,1036509,-256,-1,15794175,-572662307,-572662307,-572662307,-65315,-15732481,-587137025
                Long mem#,14644=-572662307,-572662307,-572662307,53469,0,0,-572662307,-572662307,-572662307,-572662307,-61696,15794175,-572662307,-572662307,-572657649,-572662307,-572662307,-572662307,-572662307,266198493,-572718864,-572662307
                Long mem#,14732=-572662307,-61488,-572715536,-572662307,-572662307,14540253,14540045,14540032,14540032,-790766336,-572662528,-572662307,-267398947,-256,-1,218169343,-572662307,-572662307,-572662307,-15740707,-1,-586288897,-572662307
                Long mem#,14824=-572662307,-572662307,-15793955,-1,16777215,-572662515,-572662307,-572662307,-572662307,-65328,218169343,-572662307,-572662307,-572657649,-572662307,-572662307,-572662307,-572662307,266198493,-572718864,-572662307
                Long mem#,14908=-572662307,-65315,-572662528,-572662307,-572662307,14540253,14540253,14540045,-790766336,-572662528,-572662528,-572662307,-16720419,-61696,-1,-587137025,-572662307,-572662307,-572662307,-16720419,-1,-572718849
                Long mem#,14996=-572662307,-572662307,-572662307,-65328,-1,-251658241,-572662528,-572662307,-572662307,-572662307,-16776995,-587202305,-572662307,-572662307,-572657649,-572662307,-572662307,-572662307,-572662307,266198493,-572718864
                Long mem#,15080=-572662307,-572662307,221,-572662528,-572662307,-572662307,13688285,14540253,14540045,-790766336,-572662528,-572715776,-572662307,-16720419,-1,-1,-587140865,-572662307,-572662307,-572662307,265346525,-1,-572715536
                Long mem#,15172=-572662307,-572662307,-572662307,0,0,0,-572715776,-572662307,-572662307,-572662307,-16720419,-572718849,-572662307,-572662307,-572657649,-572662307,-572662307,-572662307,-572662307,266198493,-572718864,-572662307
                Long mem#,15260=-572662307,56797,-572662307,-572662307,-572662307,56797,14540253,-790766323,-790766323,-572662528,-572719104,-572662307,13688285,-241,-1,-586350337,-572662307,-572662307,-572662307,14540253,-251658481,-572662528
                Long mem#,15348=-572662307,-572662307,-572662307,0,0,0,-572715776,-572662307,-572662307,-572662307,-16720419,-572718849,-572662307,-572662307,-572657649,-572662307,-572662307,-572662307,-572662307,266198493,-572718864,-572662307
                Long mem#,15436=-572662307,231792093,-572662307,-572662307,-572662307,-267398947,14540045,-790766115,-572662515,-790766336,-586289137,-572662307,13688285,-241,-61456,-572718864,-572662307,-572662307,-572662307,-790766115,16776960
                Long mem#,15520=-572662515,-572662307,-572662307,-572662307,-256,-1,-1,-572715536,-572662307,-572662307,-572662307,-15740707,-586288897,-572662307,-572662307,-572657649,-572662307,-572662307,-572662307,-572662307,266198493,-572718864
                Long mem#,15608=-572662307,-572662307,231792093,-572662307,-572662307,-572662307,-267398947,14540045,-790766115,-572662515,-790766336,-586289137,-572662307,14540253,-1044481,-251719696,-572715776,-572662307,-572662307,-572662307
                Long mem#,15688=-572662307,233836496,-572662307,-572662307,-572662307,-572662307,-256,-1,-1,-572715536,-572662307,-572662307,-572662307,-15740707,-586288897,-572662307,-572662307,-572657649,-572662307,-572662307,-572662307,-572662307
                Long mem#,15776=266198493,-572718864,-572662307,-572662307,231792093,-572662307,-572662307,-572662307,56797,14540253,-790766115,-572662515,-572662528,-572719104,-572662307,14540253,-16776961,4080,-572662515,-572662307,-572662307
                Long mem#,15860=-572662307,-572662307,-587202339,-572662307,-572662307,-572662307,-572662307,15793920,-251723776,-16777216,-572715536,-572662307,-572662307,-572662307,-15740707,-586288897,-572662307,-572662307,-572657649,-572662307
                Long mem#,15940=-572662307,-572662307,-572662307,266198493,-572718864,-572662307,-572662307,231792093,-572662307,-572662307,-572662307,231792093,13688285,-790766323,-790766323,-572715776,-572715568,-572662307,14540253,-16715521
                Long mem#,16020=218104048,-572662307,-572662307,-572662307,-572662307,-572662307,-587202339,-572662307,-572662307,-572662307,-572662307,15793920,-251723776,-16777216,-572715536,-572662307,-572662307,-572662307,-15740707,-586288897
                Long mem#,16100=-572662307,-572662307,-572657649,-572662307,-572662307,-572662307,-572662307,266198493,-572718864,-572662307,-572662307,221,-572662528,-572662307,-572662307,-572662307,-16720419,14540032,14540032,-572718849,-572662307
                Long mem#,16184=-572662307,14540253,-3145473,-572715536,-572662307,-572662307,-572662307,-572662307,-572662307,233836496,-572662307,-572662307,-572662307,-572662307,233897728,-251723555,-16720627,-572715536,-572662307,-572662307
                Long mem#,16264=-572662307,-16720419,-572718849,-572662307,-572662307,-572657649,-572662307,-572662307,-572662307,-572662307,266198493,-572718864,-572662307,-572662307,221,-572662528,-572662307,-572662307,-572662307,-16720419
                Long mem#,16344=265346304,14487024,-572718849,-572662307,-572662307,14540253,265293296,-572662528,-572662307,-572662307,-572662307,-572662307,-572662307,233836496,-572662307,-572662307,-572662307,-572662307,218103808,221,56589
                Long mem#,16428=-572715776,-572662307,-572662307,-572662307,13688285,-572715776,-572662307,-572662307,-572657649,-572662307,-572662307,-572662307,-572662307,266198493,-572718864,-572662307,-572662307,231792093,-572662307,-572662307
                Long mem#,16508=-572662307,-572662307,13688285,265346317,-790819344,-572715776,-572662307,-572662307,14540253,13688064,-572662528,-572662307,-572662307,-572662307,-572662307,-572662307,233836496,-572662307,-572662307,-572662307
                Long mem#,16588=-572662307,218103808,221,56589,-572715776,-572662307,-572662307,-572662307,14540253,-572662528,-572662307,-572662307,-572657649,-572662307,-572662307,-572662307,-572662307,266198493,-572718864,-572662307,-572662307
                Long mem#,16672=231792093,-572662307,-572662307,-572662307,-572662307,14540253,14540253,-572662528,-572662528,-572662307,-572662307,13688285,14540045,-572662515,-572662307,-572662307,-572662307,-572662307,-572662307,-587202339
                Long mem#,16752=-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572657649,-572662307,-572662307,-572662307
                Long mem#,16828=-572662307,266198493,-572718864,-572662307,-572662307,231792093,-572662307,-572662307,-572662307,-572662307,-572662307,-790766115,-572662515,-572662307,-572662307,-572662307,231792093,-790766115,-572662307,-572662307
                Long mem#,16908=-572662307,-572662307,-572662307,-572662307,-586297123,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307
                Long mem#,16984=-572662307,-586289137,-572662307,-572662307,-572662307,-572662307,265346525,-572718864,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307
                Long mem#,17064=-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307
                Long mem#,17140=-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,65295,0,0,0,0,-16777216,-572718864,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307
                Long mem#,17232=-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307
                Long mem#,17308=-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-241,-1,-1,-1,-1,-1,-572718864,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307
                Long mem#,17404=-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307
                Long mem#,17480=-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-256,-1,-1,-1,-1,-1,-572719104,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307
                Long mem#,17576=-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307
                Long mem#,17652=-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,-572662307,208,0,0,0,0,0,13

                assign #1,"figuren.bmp"
                openrw #1
                blockwrite #1,mem#,0,17724
                closerw #1
                
                dispose mem#

        endif

endproc