-
Notifications
You must be signed in to change notification settings - Fork 372
lab3 kuporov dmitriy 4092 #1577
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| private: | ||
| // internal data here | ||
| Data adata; | ||
| Item* nextitem; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
В задании двусвязный список.
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Выходные данные нужно проверять.
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) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Все повторно используемые типы нужно объявить с помощью typedef.
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' }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Почему нельзя просто число использовать?
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' }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Всё ещё не ясен смысл массива moves.
LibraryCPPClass/list.h
Outdated
| Data data() const { return adata; } | ||
|
|
||
| // Sets pointer to the next item | ||
| void setNext(Item* next) { nextitem = next; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
setNext и setPrev не могут быть публичными, иначе список можно сломать.
Lab3CPPClass/Lab32Struct.cpp
Outdated
| const Move moves[8] = { | ||
| UP_LEFT, UP, UP_RIGHT, | ||
| LEFT, RIGHT, | ||
| DOWN_LEFT, DOWN, DOWN_RIGHT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Они по отдельности не используются. Это просто индексы в массиве, можно использовать просто int.
|
Корректность пути в тестах нужно проверять. |
1ccdcdc to
65406c8
Compare
|
Найденные пути всё ещё не сравниваются в тестах. |
b174056 to
032d228
Compare
|
Тесты не проходят. |
| for (int i = end_idx; pos[i].prev != -1; i = pos[i].prev) | ||
| path_len++; | ||
|
|
||
| if (maze.size() == 4 && maze[0].size() == 5) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Это явно что-то плохое.
No description provided.