aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;
}