Skip to content

Commit

Permalink
fix: caro related. 🐛
Browse files Browse the repository at this point in the history
  • Loading branch information
Joker2770 committed Jun 7, 2023
1 parent 0b6475d commit 1c99b17
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 11 deletions.
2 changes: 1 addition & 1 deletion snap/gui/qpiskvork.desktop
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[Desktop Entry]
Version=0.5.42
Version=0.5.45
Encoding=UTF-8
Name=qpiskvork
Comment=A gomoku or renju manager adapting to Windows and Linux systems.
Expand Down
2 changes: 1 addition & 1 deletion snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

name: qpiskvork # you probably want to 'snapcraft register <name>'
version: '0.5.42' # just for humans, typically '1.2+git' or '1.3.2'
version: '0.5.45' # just for humans, typically '1.2+git' or '1.3.2'
summary: Another gomoku or renju manager adapting to Windows and Linux systems. # 79 char long summary
description: |
This program aims to become a gomoku or renju manager with the protocol
Expand Down
16 changes: 8 additions & 8 deletions src/caro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,15 @@ bool Caro::findShap(Board *board, const pair<int, int>& p_drt)
{
for (size_t j = 0; j <= vColor.size() - 7; ++j)
{
for (size_t i = 0; i < 16; ++i)
for (size_t i = 0; i < 20; ++i)
{
if (((WIN_SHAPES[i][0]) == (vColor[j]))
&& ((WIN_SHAPES[i][1]) == (vColor[j + 1]))
&& ((WIN_SHAPES[i][2]) == (vColor[j + 2]))
&& ((WIN_SHAPES[i][3]) == (vColor[j + 3]))
&& ((WIN_SHAPES[i][4]) == (vColor[j + 4]))
&& ((WIN_SHAPES[i][5]) == (vColor[j + 5]))
&& ((WIN_SHAPES[i][6]) == (vColor[j + 6])))
if (((WIN_SHAPES[i][0]) == (vColor[j])) &&
((WIN_SHAPES[i][1]) == (vColor[j + 1])) &&
((WIN_SHAPES[i][2]) == (vColor[j + 2])) &&
((WIN_SHAPES[i][3]) == (vColor[j + 3])) &&
((WIN_SHAPES[i][4]) == (vColor[j + 4])) &&
((WIN_SHAPES[i][5]) == (vColor[j + 5])) &&
((WIN_SHAPES[i][6]) == (vColor[j + 6])))
{
return true;
}
Expand Down
4 changes: 4 additions & 0 deletions src/caro.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,19 @@
using namespace std;

const int WIN_SHAPES[][7] = {
{1, 1, 1, 1, 1, 0, 0},
{0, 1, 1, 1, 1, 1, 0},
{0, 0, 1, 1, 1, 1, 1},
{2, 1, 1, 1, 1, 1, 0},
{2, 1, 1, 1, 1, 1, 1},
{0, 1, 1, 1, 1, 1, 2},
{1, 1, 1, 1, 1, 1, 2},
{1, 1, 1, 1, 1, 1, 1},
{0, 1, 1, 1, 1, 1, 1},
{1, 1, 1, 1, 1, 1, 0},
{2, 2, 2, 2, 2, 0, 0},
{0, 2, 2, 2, 2, 2, 0},
{0, 0, 2, 2, 2, 2, 2},
{1, 2, 2, 2, 2, 2, 0},
{1, 2, 2, 2, 2, 2, 2},
{0, 2, 2, 2, 2, 2, 1},
Expand Down
2 changes: 1 addition & 1 deletion src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1877,7 +1877,7 @@ void MainWindow::OnActionNumOfMove()

void MainWindow::OnActionVer()
{
const QString strVerNum = "Ver Num: 0.5.42\n";
const QString strVerNum = "Ver Num: 0.5.45\n";
QString strBuildTime = "Build at ";
strBuildTime.append(__TIMESTAMP__);
strBuildTime.append("\n");
Expand Down

0 comments on commit 1c99b17

Please sign in to comment.