aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortomsmeding <hallo@tomsmeding.nl>2015-04-27 20:36:43 +0200
committertomsmeding <hallo@tomsmeding.nl>2015-04-27 20:36:43 +0200
commitf7cf72b6a1cd5373f39e025ae260561e33a91e8e (patch)
treea105ddb53ef8e07eacbf723637dfe3ff75eaa5de
parente3c5e6c4e7f5e48fcb9d8f317628b87c8a78b1cf (diff)
Update charm and add to makefile
-rw-r--r--Makefile5
-rw-r--r--charm.cpp5
2 files changed, 8 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 6e94ba2..63cde7d 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
.PHONY: all clean
-BINARIES = neutrino randino gluon photon viewcompetition
+BINARIES = neutrino randino gluon photon viewcompetition charm
all: $(BINARIES)
@@ -19,6 +19,9 @@ photon: photon.cc higgs.o
randino: randino.cpp
g++ -Wall -std=c++11 -O2 -o randino randino.cpp
+charm: charm.cpp
+ g++ -Wall -std=c++11 -O2 -o charm charm.cpp
+
higgs.o: higgs.cc
g++ -Wall -std=c++11 -O2 -c -o higgs.o higgs.cc
diff --git a/charm.cpp b/charm.cpp
index 1434e8c..56af6c5 100644
--- a/charm.cpp
+++ b/charm.cpp
@@ -109,7 +109,10 @@ int scorefor(const Board &bd){
for(i=0;i<S*S;i++){
if(bd.grid[i]==1)score+=i/S;
else if(bd.grid[i]==2)score-=i/S;
- else if(bd.grid[i]==3)score-=(i/S)*(i/S);
+ else if(bd.grid[i]==3){
+ score-=(i/S)*(i/S);
+ if(i<S)score+=10000;
+ }
}
return score;
}