Results 1 to 2 of 2

Thread: Strings Not Working

Threaded View

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jul 1999
    Posts
    1,800

    Angry Strings Not Working

    Okay Im making a checkers (no parksie, not "draughts", CHECKERS) game, but I'm having some trouble. All I need to do is check the board, if there is an X, then put an X onto the end of another string. I've been using sprintf but its not working, the string always comes up empty

    Heres The Bulk Of The Code Thats Not Working
    PHP Code:
            for(i=1i<=3i++)  {
                for(
    a=1a<=8a++)  {
                    if(
    a%== 0)  {
                        
    board[i][a] = 'X';
                    }
                    if(
    a%!= 0)  {
                        
    board[i][a] = '_';
                    }
                }
            }

            for(
    i=1i<=8i++)  {
                for(
    a=1a<=8a++) {
                    if(
    board[i][a] == '_')  {
                        
    sprintf(FinalBoard"_");
                    }
                    if(
    board[i][a]=='X')  {
                        
    sprintf(FinalBoard"X");
                    }
                    
    sprintf(FinalBoard"  ");
                }
            }

        
    SendMessage(GameBoardWM_SETTEXT0, (LPARAM) (LPCSTRFinalBoard); 
    board is the board with x and y coordinates. FinalBoard is the string I want to put the X in if there is an X....if not it puts an underscore.


    If it helps. here's the cpp file
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width