View Single Post
Old 23 May 2020, 13:01   #3
Toki
Registered User

Toki's Avatar
 
Join Date: Feb 2016
Location: Birmingham
Age: 56
Posts: 62
Thanks for the suggestion.

The code finishes with the following (it's the two "ReplyMsg(message)" functions which the compiler has the warning about). The program still compiles, and the window opens fine but the games doesn't play. Here's how the code finishes with the two ReplyMsg(message) functions. I could copy and paste the entire code, but it might be too large to post:

Code:
        do {
            do{
                /* put up message telling player it's their turn */
                
                SetAPen(rp,4);  /* pen colour */
                Move(rp,283,18);
                Text(rp,"Your Move",9);
                
                Wait(1L<< CurrentWindow->UserPort->mp_SigBit);  /* wait until we receive message */
                /* find out the kind of message received */
                message+(struct IntuiMessage *)GetMsg(CurrentWindow->UserPort);
                
                class=message->Class;
                Humansmove=getmove(class,message);
                ReplyMsg(message);
                if (class!=CLOSEWINDOW) {
                    /* if user hasnit closed the window , then wait for and get next message */
                    /*  This absorbs the mouse button release message
                    Intuition fives after the user clicks the mouse */
                    Wait(1L<< CurrentWindow->UserPort->mp_SigBit);  /* wait
                    for message */
                        message = (struct IntuiMessage *)GetMsg(
                    CurrentWindow->UserPort);
                    
                    ReplyMsg(message);
                    }
                } while (class!=CLOSEWINDOW && HumansMove<0);  /* repeat until user 
                selects close or enters a valis move */
                if (class ==CLOSEWINDOW)
                TimeToQuit=true;
            else {
                drawpieces(Human,HumansMove,NextFree[HumansMove]);
                AlterBoard(TheBoard,Human,Humansmove);
                
                /* let player know computer is thinking */
                SetAPen(rp,4); /* set pen colur */
                Move(rp,283,18);
                Text(rp,"My move  ",9);
                
    ComputersMove = BestMove(TheBoard,Computer,LookAhead,&ComputersScore);
                drawpiece(Computer,ComputersMove,NextFree[ComputersMove]);
                AlterBoard(TheBoard,Computer,ComputersMove);
                }
             } while (TimeToQuit==false);  /* repeat until user asks to
             close the window */
             }
             
             void main(void)
             {
                PlayGame();
                ReleaseResources();
                }
Toki is offline  
 
Page generated in 0.05157 seconds with 11 queries