Skip to content

lab3 kuporov dmitriy 4092#1577

Closed
dimar1k77 wants to merge 45 commits into
Dovgalyuk:masterfrom
dimar1k77:master
Closed

lab3 kuporov dmitriy 4092#1577
dimar1k77 wants to merge 45 commits into
Dovgalyuk:masterfrom
dimar1k77:master

Conversation

@dimar1k77

Copy link
Copy Markdown

No description provided.

Comment thread LibraryCPPClass/list.h
private:
// internal data here
Data adata;
Item* nextitem;

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

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

Comment thread Lab3CPPClass/CMakeLists.txt Outdated

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
Copy Markdown
Owner

Choose a reason for hiding this comment

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

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

Comment thread Lab3CPPClass/Lab32Struct.cpp Outdated
return {};
}

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

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

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

Comment thread Lab3CPPClass/Lab32Struct.cpp Outdated

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
Copy Markdown
Owner

Choose a reason for hiding this comment

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

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

Comment thread Lab3CPPClass/Lab32Struct.cpp Outdated
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
Copy Markdown
Owner

Choose a reason for hiding this comment

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

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

Comment thread LibraryCPPClass/list.h Outdated
Data data() const { return adata; }

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

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

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

Comment thread Lab3CPPClass/Lab32Struct.cpp Outdated
const Move moves[8] = {
UP_LEFT, UP, UP_RIGHT,
LEFT, RIGHT,
DOWN_LEFT, DOWN, DOWN_RIGHT

Copy link
Copy Markdown
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
Copy Markdown
Owner

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

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

Dovgalyuk commented Dec 19, 2025

Copy link
Copy Markdown
Owner

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

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
Copy Markdown
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
Copy Markdown
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