Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Feb 1, 2015, 2:55:44 PM (9 years ago)
Author:
landauf
Message:

replaced tabs with spaces. no changes in code.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/minigame4DHS14/src/modules/mini4dgame/Mini4DgameAI.cc

    r10225 r10230  
    7474    Vector4 Mini4DgameAI::makeMove(float timeout)
    7575    {
    76         this->copyBoard();
    77         std::list<Vector4> possibleMoves = this->getPossibleMoves();
     76        this->copyBoard();
     77        std::list<Vector4> possibleMoves = this->getPossibleMoves();
    7878
    79         //TODO: alphabeta ueber possibleMoves
     79        //TODO: alphabeta ueber possibleMoves
    8080
    81         //when timeout
    82         Vector4 move = possibleMoves.front();
    83         return move;
     81        //when timeout
     82        Vector4 move = possibleMoves.front();
     83        return move;
    8484    }
    8585
    8686    void Mini4DgameAI::copyBoard()
    8787    {
    88                 for(int i=0;i<4;i++){
    89                         for(int j=0;j<4;j++){
    90                                 for(int k=0;k<4;k++){
    91                                         for(int l=0;l<4;l++){
    92                                                 this->board_[i][j][k][l]=this->center_->board[i][j][k][l];
    93                                         }
    94                                 }
    95                         }
    96                 }
     88        for(int i=0;i<4;i++){
     89            for(int j=0;j<4;j++){
     90                for(int k=0;k<4;k++){
     91                    for(int l=0;l<4;l++){
     92                        this->board_[i][j][k][l]=this->center_->board[i][j][k][l];
     93                    }
     94                }
     95            }
     96        }
    9797    }
    9898
    9999    std::list<Vector4> Mini4DgameAI::getPossibleMoves()
    100100    {
    101         std::list<Vector4> possibleMoves = new std::list<Vector4>;
    102         for(int i=0;i<4;i++){
    103                         for(int j=0;j<4;j++){
    104                                 for(int k=0;k<4;k++){
    105                                         for(int l=0;l<4;l++){
    106                                                 if (this->board_[i][j][k][l]==mini4DgamePlayerColor::none)
    107                                                         possibleMoves.push_back(Vector4(i,j,k,l));
    108                                         }
    109                                 }
    110                         }
    111                 }
    112         return possibleMoves;
     101        std::list<Vector4> possibleMoves = new std::list<Vector4>;
     102        for(int i=0;i<4;i++){
     103            for(int j=0;j<4;j++){
     104                for(int k=0;k<4;k++){
     105                    for(int l=0;l<4;l++){
     106                        if (this->board_[i][j][k][l]==mini4DgamePlayerColor::none)
     107                            possibleMoves.push_back(Vector4(i,j,k,l));
     108                    }
     109                }
     110            }
     111        }
     112        return possibleMoves;
    113113    }
    114114
Note: See TracChangeset for help on using the changeset viewer.