Record Detail

Compile Error

In file included from /in/Compile/check.cpp:7:
/in/sokoban.hpp:126:32: error: implicit conversion changes signedness: 'int' to 'unsigned long' [-Werror,-Wsign-conversion]
            if (board[position+pos[i][0]]=='#'||state.boxes[position+pos[i][0]]=='B'){
                              ~^~~~~~~~~
/in/sokoban.hpp:126:70: error: implicit conversion changes signedness: 'int' to 'unsigned long' [-Werror,-Wsign-conversion]
            if (board[position+pos[i][0]]=='#'||state.boxes[position+pos[i][0]]=='B'){
                                                                    ~^~~~~~~~~
/in/sokoban.hpp:129:32: error: implicit conversion changes signedness: 'int' to 'unsigned long' [-Werror,-Wsign-conversion]
            if (board[position+pos[i][1]]=='#'||state.boxes[position+pos[i][1]]=='B'){
                              ~^~~~~~~~~
/in/sokoban.hpp:129:70: error: implicit conversion changes signedness: 'int' to 'unsigned long' [-Werror,-Wsign-conversion]
            if (board[position+pos[i][1]]=='#'||state.boxes[position+pos[i][1]]=='B'){
                                                                    ~^~~~~~~~~
/in/sokoban.hpp:132:32: error: implicit conversion changes signedness: 'int' to 'unsigned long' [-Werror,-Wsign-conversion]
            if (board[position+pos[i][2]]=='#'||state.boxes[position+pos[i][2]]=='B'){
                              ~^~~~~~~~~
/in/sokoban.hpp:132:70: error: implicit conversion changes signedness: 'int' to 'unsigned long' [-Werror,-Wsign-conversion]
            if (board[position+pos[i][2]]=='#'||state.boxes[position+pos[i][2]]=='B'){
                                                                    ~^~~~~~~~~
/in/sokoban.hpp:145:32: error: implicit conversion changes signedness: 'int' to 'unsigned long' [-Werror,-Wsign-conversion]
    size_t next = size_t(state.player + dir.first*col + dir.second);
                         ~~~~~~^~~~~~ ~
/in/sokoban.hpp:145:45: error: implicit conversion changes signedness: 'int' to 'unsigned long' [-Werror,-Wsign-conversion]
    size_t next = size_t(state.player + dir.first*col + dir.second);
                                        ~~~~^~~~~~
/in/sokoban.hpp:145:61: error: implicit conversion changes signedness: 'int' to 'unsigned long' [-Werror,-Wsign-conversion]
    size_t next = size_t(state.player + dir.first*col + dir.second);
                                                      ~ ~~~~^~~~~~
/in/sokoban.hpp:146:41: error: implicit conversion changes signedness: 'int' to 'unsigned long' [-Werror,-Wsign-conversion]
    size_t nextnext = size_t(next + dir.first*col + dir.second);
                                    ~~~~^~~~~~
/in/sokoban.hpp:146:57: error: implicit conversion changes signedness: 'int' to 'unsigned long' [-Werror,-Wsign-conversion]
    size_t nextnext = size_t(next + dir.first*col + dir.second);
                                                  ~ ~~~~^~~~~~
/in/sokoban.hpp:158:32: error: implicit conversion changes signedness: 'int' to 'unsigned long' [-Werror,-Wsign-conversion]
    size_t next = size_t(state.player + dir.first*col + dir.second);
                         ~~~~~~^~~~~~ ~
/in/sokoban.hpp:158:45: error: implicit conversion changes signedness: 'int' to 'unsigned long' [-Werror,-Wsign-conversion]
    size_t next = size_t(state.player + dir.first*col + dir.second);
                                        ~~~~^~~~~~
/in/sokoban.hpp:158:61: error: implicit conversion changes signedness: 'int' to 'unsigned long' [-Werror,-Wsign-conversion]
    size_t next = size_t(state.player + dir.first*col + dir.second);
                                                      ~ ~~~~^~~~~~
/in/sokoban.hpp:160:45: error: implicit conversion changes signedness: 'int' to 'unsigned long' [-Werror,-Wsign-conversion]
        size_t nextnext = size_t(next + dir.first*col + dir.second);
                                        ~~~~^~~~~~
/in/sokoban.hpp:160:61: error: implicit conversion changes signedness: 'int' to 'unsigned long' [-Werror,-Wsign-conversion]
        size_t nextnext = size_t(next + dir.first*col + dir.second);
                                                      ~ ~~~~^~~~~~
/in/sokoban.hpp:162:35: error: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'std::vector<int, std::allocator<int> >::value_type' (aka 'int') [-Werror,-Wshorten-64-to-32]
        new_state.boxes.push_back(nextnext);
                        ~~~~~~~~~ ^~~~~~~~
/in/sokoban.hpp:164:24: error: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'int' [-Werror,-Wshorten-64-to-32]
    new_state.player = next;
                     ~ ^~~~
/in/sokoban.hpp:213:43: error: implicit conversion loses integer precision: 'unsigned long' to 'std::vector<int, std::allocator<int> >::value_type' (aka 'int') [-Werror,-Wshorten-64-to-32]
                targets.push_back(i * col + j);
                        ~~~~~~~~~ ~~~~~~~~^~~
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
/in/Compile/Makefile:16: recipe for target 'main' failed
make: *** [main] Error 1

Information

Submit By
Type
Submission
Homework
Project3
Language
C++
Submit At
2024-11-28 02:38:25
Judged At
2024-11-28 02:38:25
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes