Do you think that you can fix my C++ code it's a chess engine stripped down to the essentials it's all here

int posmove(int tmove,int sw,int n,int r)

if (r)

for (pb=0;pb<64;pb++)

{

iboard(pb)=rboard(pb)

else

{

rboard(pb)=iboard(pb)

}

}

for (trtv=6;trtv>0;trtv--)

{

for (serb=tmove%64;serb<4096;serb+=64)

{

if ( iblegal( serb) && (7 * !sw)-1< iboard(ceil(serb/64)) && iboard(serb%64)=trtv+6*sw && !r) || ( iblegal( serb) && (7 * sw)-1< iboard(serb%64) && iboard(ceil(serb/64))=trtv+6*!sw && r)

{

if ceil(serb/64)==mth

{

ptc(ceil(serb/64)+=trtv

}

mth=ceil(serb/64)

}

for(spl=0;spl<64;spl++)

{

if pic(spl)>pic(spo)

{

spo=spl

}

}

if (!sw)

{

if sw && spo==ceil(serb/64))

{

re=1

nnum=serbit

}

else

{

nnum=serb

re=0

}

if (n>38)

{

return fmove

}

else

{

}

serbit=serb

iboard(ceil(serb/64))=iboard(serb%64)

iboard(serb%64)=0

posmove (nnum,!sw,n++,re)

)

2 Answers

Relevance
  • 1 decade ago
    Favorite Answer

    int posmove(int tmove,int sw,int n,int r)

    if (r)

    for (pb=0;pb<64;pb++);

    {

    iboard(pb)=rboard(pb);

    else

    {

    rboard(pb)=iboard(pb);

    }

    }

    for (trtv=6;trtv>0;trtv--)

    {

    for (serb=tmove%64;serb<4096;serb+)

    {

    if ( iblegal( serb) && (7 * !sw)-1< iboard(ceil(serb/64)) && iboard(serb/64)=trtv+6*sw && !r) || ( iblegal( serb) && (7 * sw)-1< iboard(serb/64) && iboard(ceil(serb/64))=trtv+6*!... && r)

    {

    if ceil(serb/64)==mth

    {

    ptc(ceil(serb/64)+=trtv;

    }

    mth=ceil(serb/64);

    }

    for(spl=0;spl<64;spl++)

    {

    if pic(spl)>pic(spo)

    {

    spo=spl;

    }

    }

    if (!sw)

    {

    if sw && spo==ceil(serb/64))

    {

    re=1;

    nnum=serbit;

    }

    else

    {

    nnum=serb;

    re=0;

    }

    if (n>38)

    {

    return fmove;

    }

    else

    {

    return 1;

    }

    serbit=serb;

    iboard(ceil(serb/64))=iboard(siboard(serb/64)=0;

    posmove (nnum,!sw,n++,re);

    }

    You need ; and no %'s in the code.

    • Commenter avatarLogin to reply the answers
  • 1 decade ago

    no

    • Commenter avatarLogin to reply the answers
Still have questions? Get your answers by asking now.