Record Detail

Compile Error

In file included from /in/Compile/check.cpp:7:
/in/sokoban.hpp:284:17: error: use of undeclared identifier 'is_valid'
            if (is_valid(nx, ny, rows, cols, grid) && !visited[static_cast<size_t>(nx)][static_cast<size_t>(ny)]) {
                ^
/in/sokoban.hpp:316:22: error: non-local lambda expression cannot have a capture-default
    auto is_valid = [&](int x, int y) {
                     ^
/in/sokoban.hpp:317:52: error: use of undeclared identifier 'rows'
        return x >= 0 &&  static_cast<size_t>(x) < rows && y >= 0 && static_cast<size_t>(y) < cols && grid[static_cast<size_t>(x)][static_cast<size_t>(y)] != '#';
                                                   ^
/in/sokoban.hpp:317:95: error: use of undeclared identifier 'cols'
        return x >= 0 &&  static_cast<size_t>(x) < rows && y >= 0 && static_cast<size_t>(y) < cols && grid[static_cast<size_t>(x)][static_cast<size_t>(y)] != '#';
                                                                                              ^
/in/sokoban.hpp:317:103: error: use of undeclared identifier 'grid'
        return x >= 0 &&  static_cast<size_t>(x) < rows && y >= 0 && static_cast<size_t>(y) < cols && grid[static_cast<size_t>(x)][static_cast<size_t>(y)] != '#';
                                                                                                      ^
/in/Compile/check.cpp:67:6: error: redefinition of 'is_valid' as different kind of symbol
bool is_valid(int x, int y, int m, int n, const vector<string>& grid) {
     ^
/in/sokoban.hpp:316:10: note: previous definition is here
    auto is_valid = [&](int x, int y) {
         ^
/in/Compile/check.cpp:143:14: error: no matching function for call to object of type '(lambda at /in/sokoban.hpp:316:21)'
        if (!is_valid(px_n, py_n, m, n, grid)) {
             ^~~~~~~~
/in/sokoban.hpp:316:21: note: candidate function not viable: requires 2 arguments, but 5 were provided
    auto is_valid = [&](int x, int y) {
                    ^
/in/Compile/check.cpp:150:18: error: no matching function for call to object of type '(lambda at /in/sokoban.hpp:316:21)'
            if (!is_valid(bx_n, by_n, m, n, grid) || grid[(size_t)bx_n][(size_t)by_n] == 'B' || grid[(size_t)bx_n][(size_t)by_n] == 'R') {
                 ^~~~~~~~
/in/sokoban.hpp:316:21: note: candidate function not viable: requires 2 arguments, but 5 were provided
    auto is_valid = [&](int x, int y) {
                    ^
8 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-27 23:11:06
Judged At
2024-11-27 23:11:06
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes