aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortomsmeding <hallo@tomsmeding.nl>2015-04-27 11:28:34 +0200
committertomsmeding <hallo@tomsmeding.nl>2015-04-27 11:28:34 +0200
commita7f94036e9b14bde1aaf497e1aa797b41ce6ea3f (patch)
treef249c220531b229a3510376bda41edfe4a127a5e
parente8e24f187f451d51551a1db76321e03efe94cc9d (diff)
FINALLY make randino WORK
-rw-r--r--randino.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/randino.cpp b/randino.cpp
index bb3d917..be5e0f3 100644
--- a/randino.cpp
+++ b/randino.cpp
@@ -66,8 +66,8 @@ public:
}
bool isvalid(Move mv){
int oldneuidx=neuidx;
- cerr<<"Called isvalid with move ";
- protocol_put_move(cerr,mv);
+ //cerr<<"Called isvalid with move ";
+ //protocol_put_move(cerr,mv);
//print();
if(!move(oldneuidx,mv.neudir)){
//undomove(oldneuidx,mv.neudir);
@@ -116,8 +116,8 @@ Move calculate_move(Board &bd){
m.from=fr;
m.dir=d;
if(bd.isvalid(m)){
- cerr<<"push: ";
- protocol_put_move(cerr,m);
+ //cerr<<"push: ";
+ //protocol_put_move(cerr,m);
poss.push_back(m);
}
}
@@ -138,6 +138,7 @@ Move protocol_get_move(void){
Move m;
char c=cin.peek();
if(c=='q'||c=='Q')exit(0);
+ cin>>m.neudir>>m.from>>m.dir;
if(should_flip_board){
m.neudir=flip_dir(m.neudir);
m.from=flip_index(m.from);
@@ -164,8 +165,8 @@ int main(void){
struct timeval tv;
gettimeofday(&tv,NULL);
cerr<<"seed="<<(1000000*tv.tv_sec+tv.tv_usec)<<endl;
- //srand(1000000*tv.tv_sec+tv.tv_usec);
- srand(1430075262226814);
+ srand(1000000*tv.tv_sec+tv.tv_usec);
+ //srand(1430075262226814);
getline(cin,line);
if(line=="go"){
should_flip_board=false;