aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzedarider <ymherklotz@gmail.com>2016-11-24 17:51:57 +0000
committerzedarider <ymherklotz@gmail.com>2016-11-24 17:51:57 +0000
commitbea3f2ee3a313049c3513b3eedf5cb6519f19729 (patch)
tree1474c4e55dcdc39d8e8abf3dcb7089cf8f5ed34d
parent4716585d5acb45b00960eebb4f8ae4580e580da0 (diff)
downloadChessAI-bea3f2ee3a313049c3513b3eedf5cb6519f19729.tar.gz
ChessAI-bea3f2ee3a313049c3513b3eedf5cb6519f19729.zip
old changes
-rw-r--r--Makefile2
-rw-r--r--include/chess_ai.hpp9
2 files changed, 9 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 3c0f9e7..1612948 100644
--- a/Makefile
+++ b/Makefile
@@ -7,7 +7,7 @@ TARGET := bin/chess_ai
SRCEXT := cpp
SOURCES := $(shell find $(SRCDIR) -type f -name "*.$(SRCEXT)")
OBJECTS := $(patsubst $(SRCDIR)/%,$(BUILDDIR)/%,$(SOURCES:.$(SRCEXT)=.o))
-CFLAGS := -g -Wall -Wextra
+CFLAGS := -g -Wall -Wextra -std=c++14
LIB :=
INC := -I include
diff --git a/include/chess_ai.hpp b/include/chess_ai.hpp
index c682bd2..2984d49 100644
--- a/include/chess_ai.hpp
+++ b/include/chess_ai.hpp
@@ -3,8 +3,8 @@
#define CHESS_BOARD_SIZE 8
-#include <vector>
#include <iostream>
+#include <vector>
#include <string>
namespace chess_ai {
@@ -150,6 +150,13 @@ namespace chess_ai {
// overload ++ operator for pawns
chess_piece& operator++() {
+ if(this->type == pawn) {
+ if(this->colour == white) {
+ --pawn->y;
+ } else {
+ ++pawn->y;
+ }
+ }
return *this;
}