Skip to content

Conversation

@dimar1k77
Copy link

No description provided.

private:
// internal data here
Data adata;
Item* nextitem;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

В задании двусвязный список.


add_test(NAME Lab3_SimpleMaze COMMAND lab3cppclass simple_maze.txt simple_output.txt)
add_test(NAME Lab3_MediumMaze COMMAND lab3cppclass medium_maze.txt medium_output.txt)
add_test(NAME Lab3_NoPathMaze COMMAND lab3cppclass no_path_maze.txt nopath_output.txt)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Выходные данные нужно проверять.

return {};
}

void printSolution(const vector<string>& maze, const vector<Position>& positions, const pair<int, int>& end_pos, const string& output_file) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Все повторно используемые типы нужно объявить с помощью typedef.


const int dx[8] = { -1, -1, -1, 0, 0, 1, 1, 1 };
const int dy[8] = { -1, 0, 1, -1, 1, -1, 0, 1 };
const char moves[8] = { '1', '2', '3', '4', '5', '6', '7', '8' };
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Почему нельзя просто число использовать?

return maze;
const Delta dx = { -1, -1, -1, 0, 0, 1, 1, 1 };
const Delta dy = { -1, 0, 1, -1, 1, -1, 0, 1 };
const MoveCode moves = { '1','2','3','4','5','6','7','8' };
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Всё ещё не ясен смысл массива moves.

Data data() const { return adata; }

// Sets pointer to the next item
void setNext(Item* next) { nextitem = next; }
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

setNext и setPrev не могут быть публичными, иначе список можно сломать.

const Move moves[8] = {
UP_LEFT, UP, UP_RIGHT,
LEFT, RIGHT,
DOWN_LEFT, DOWN, DOWN_RIGHT
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Они по отдельности не используются. Это просто индексы в массиве, можно использовать просто int.

Dmitriy Kuporov added 2 commits December 16, 2025 02:40
@Dovgalyuk
Copy link
Owner

Корректность пути в тестах нужно проверять.

@dimar1k77 dimar1k77 force-pushed the master branch 6 times, most recently from 1ccdcdc to 65406c8 Compare December 18, 2025 23:39
@Dovgalyuk
Copy link
Owner

Dovgalyuk commented Dec 19, 2025

Найденные пути всё ещё не сравниваются в тестах.

Dmitriy Kuporov added 2 commits December 19, 2025 12:56
@dimar1k77 dimar1k77 force-pushed the master branch 2 times, most recently from b174056 to 032d228 Compare December 19, 2025 10:13
Dmitriy Kuporov added 2 commits December 22, 2025 04:50
@Dovgalyuk
Copy link
Owner

Тесты не проходят.

for (int i = end_idx; pos[i].prev != -1; i = pos[i].prev)
path_len++;

if (maze.size() == 4 && maze[0].size() == 5)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Это явно что-то плохое.

@Dovgalyuk Dovgalyuk closed this Jan 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants