Record Detail

Compile Error

In file included from /in/Compile/check.cpp:7:
/in/sokoban.hpp:15:17: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
    grid.resize(row);
         ~~~~~~ ^~~
/in/sokoban.hpp:18:37: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
        std::getline(std::cin, grid[i]);
                               ~~~~ ^
/in/sokoban.hpp:39:25: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
               grid[pos.row][pos.col] != '#';
               ~~~~ ~~~~^~~
/in/sokoban.hpp:39:34: error: implicit conversion changes signedness: 'int' to 'std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
               grid[pos.row][pos.col] != '#';
               ~~~~          ~~~~^~~
/in/sokoban.hpp:86:30: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
            char cell = grid[i][j];
                        ~~~~ ^
/in/sokoban.hpp:86:33: error: implicit conversion changes signedness: 'int' to 'std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
            char cell = grid[i][j];
                        ~~~~    ^
/in/sokoban.hpp:114:68: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
            Position nextPlayer = {current.player.row + directions[i].first,
                                                        ~~~~~~~~~~ ^
/in/sokoban.hpp:115:68: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
                                   current.player.col + directions[i].second};
                                                        ~~~~~~~~~~ ^
/in/sokoban.hpp:124:67: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
                Position behindBox = {nextPlayer.row + directions[i].first,
                                                       ~~~~~~~~~~ ^
/in/sokoban.hpp:125:67: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
                                      nextPlayer.col + directions[i].second};
                                                       ~~~~~~~~~~ ^
/in/sokoban.hpp:140:41: error: implicit conversion changes signedness: 'int' to 'std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
            nextState.moves += dirChars[i];
                               ~~~~~~~~ ^
11 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-26 23:07:30
Judged At
2024-11-26 23:07:30
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes