• R/O
  • SSH

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Nonogram solver


Commit MetaInfo

Revisãoc8b492b56d3d160aaf1e241480a5064c27a61d9d (tree)
Hora2021-02-16 04:25:36
AutorAlexander Larin <scalar438@gmai...>
CommiterAlexander Larin

Mensagem de Log

Another small changes

Mudança Sumário

Diff

diff -r bb387d75e419 -r c8b492b56d3d cell.cpp
--- a/cell.cpp Mon Feb 15 22:09:55 2021 +0300
+++ b/cell.cpp Mon Feb 15 22:25:36 2021 +0300
@@ -27,7 +27,7 @@
2727 {
2828 // TODO: replace it to actual exception
2929 if (max_colors > MAX_COLORS) throw 42;
30- m_data = 1u >> (max_colors + 1) - 1u;
30+ m_data = (1u << (max_colors + 1)) - 1u;
3131 }
3232
3333 std::optional<int> Cell::get_color() const
@@ -39,7 +39,7 @@
3939
4040 bool Cell::is_color_possible(int color_number) const
4141 {
42- return m_data & (1u << color_number) != 0;
42+ return (m_data & (1u << color_number)) != 0;
4343 }
4444
4545 bool Cell::is_impossible() const
diff -r bb387d75e419 -r c8b492b56d3d row_solver.cpp
--- a/row_solver.cpp Mon Feb 15 22:09:55 2021 +0300
+++ b/row_solver.cpp Mon Feb 15 22:25:36 2021 +0300
@@ -4,7 +4,8 @@
44 std::vector<int> adjust(std::vector<Cell> &cells, std::vector<std::pair<int, int>> &block_list)
55 {
66 const size_t n = cells.size();
7- if (n == 0) return {};
7+ std::vector<int> res;
8+ if (n == 0) return res;
89
910 const int max_colors = cells[0].max_colors();
1011 const size_t k = block_list.size();
@@ -51,4 +52,5 @@
5152 for (int i = 0; i <= max_colors; ++i)
5253 {}
5354 }
55+ return res;
5456 }
\ No newline at end of file