RE: [computer-go] Re: Update of MoGo binary release, and windows version available! (repost)
Thanks Hideki, Chris and Jacques for your replies. Hideki wrote: Then, you can make a very simple program that passes a file to stdout first and passes stdin to stdout after the end-of-file of the file. And use it as a.out file | mogo arguments. Is this not the way a tail -f works? This is the method I use with gnugo to let te programs play against each other. The communication between the programs and server program are all using files. This seems fast enough, while I can check all the communications which took place. This tail -f fails in the same way. To check things even more, I tried to communicate using C with popen(): FILE *ptr; if ((ptr = popen(mogo --9 --nbTotalSimulations 3000 mogoout, w)) != NULL) { fprintf(ptr, boardsize 9\n); fprintf(ptr, genmove b\n); sleep(60); } But the result is the same, after these commands, mogo still continues to perform multiple genmoves. I am puzzled here... I will look at the ruby script, and there are also twogtp scripts of gnugo in python, perl etc. which I could check. Edward. _ Probeer Live.nl Probeer Live.nl: zoekmachine van de makers van MSN! ___ computer-go mailing list computer-go@computer-go.org http://www.computer-go.org/mailman/listinfo/computer-go/
Re: [computer-go] Re: Update of MoGo binary release, and windows version available! (repost)
Edward de Grijs: [EMAIL PROTECTED]: Thanks Hideki, Chris and Jacques for your replies. Hideki wrote: Then, you can make a very simple program that passes a file to stdout first and passes stdin to stdout after the end-of-file of the file. And use it as a.out file | mogo arguments. Is this not the way a tail -f works? I don't know the way tail -f works but I guess _no_ as tail never use stdin. That is, the program opens the file at first and copy it to stdout unitl end-of-file. Then the program closes the file and opens stdin and copy it to stdout. This is the method I use with gnugo to let te programs play against each other. The communication between the programs and server program are all using files. This seems fast enough, while I can check all the communications which took place. This tail -f fails in the same way. To check things even more, I tried to communicate using C with popen(): FILE *ptr; if ((ptr = popen(mogo --9 --nbTotalSimulations 3000 mogoout, w)) != NULL) { fprintf(ptr, boardsize 9\n); fprintf(ptr, genmove b\n); sleep(60); } But the result is the same, after these commands, mogo still continues to perform multiple genmoves. I am puzzled here... I guess above code does not work. Probably MoGo reads the last line repeatedly when end-of-file occurs. Hideki I will look at the ruby script, and there are also twogtp scripts of gnugo in python, perl etc. which I could check. Edward. _ Probeer Live.nl Probeer Live.nl: zoekmachine van de makers van MSN! inline file ___ computer-go mailing list computer-go@computer-go.org http://www.computer-go.org/mailman/listinfo/computer-go/ -- [EMAIL PROTECTED] (Kato) ___ computer-go mailing list computer-go@computer-go.org http://www.computer-go.org/mailman/listinfo/computer-go/
Re: [computer-go] Re: Update of MoGo binary release, and windows version available! (repost)
Hi Edward, Edward de Grijs: [EMAIL PROTECTED]: Hi Hideki, The file is used by: cat file | mogo arguments I guess MoGo doesn't check end-of-file of stdin. Adding quit to the file lets mogo quit the game, but I want to let mogo wait for the obvious next command like play b vertex Then, you can make a very simple program that passes a file to stdout first and passes stdin to stdout after the end-of-file of the file. And use it as a.out file | mogo arguments. Hope this helps, Hideki Normally I use the pipe with a self made server program that send a new line through the pipe each time one of the two programs, which are competing, generate a move. This works for my program, and also for gnugo, but mogo reacts differently. Maybe I am using a wrong method, or there are much better ways to do this, please let me know. How do others let programs play against each other while maintaining full control as a server? Thanks, Edward. Date: Wed, 5 Dec 2007 22:17:03 +0900 From: [EMAIL PROTECTED] Subject: Re: [computer-go] Re: Update of MoGo binary release, and windows version available! To: computer-go@computer-go.org Adding quit does not help? Edward de Grijs: [EMAIL PROTECTED]: Hi to all, Can someone help me with this problem, for which I cannot find a solution: I am trying to run MoGo in an automatic way, using the cygwin toolkit. The problem in its simplest form is this: If I use MoGo on the command line, typing the commands which are send by stdin (i suppose) it works perfectly. If I make a file with command like: boardsize 9 genmove w Then MoGo will continue to perform a genmove, and can only be stopped by killing it. I vagely suspect that it has something to do with non-blocking input, but I also do not know all the aspects of this. To be honest, I tried to implement pondering using non-blocking input, but that did not work out this way, because of some alike problems... Now I can run GoGui, and this program seems to work fine with Mogo, so it must be possible to interact automatically. Can you help me? What am I doing wrong? Thanks, Edward _ De mooiste afbeeldingen van Angelina Jolie vind je met Live Search http://search.live.com/images/results.aspx?q=angelina%20jolieFORM=QBIR inline file ___ computer-go mailing list computer-go@computer-go.org http://www.computer-go.org/mailman/listinfo/computer-go/ -- [EMAIL PROTECTED] (Kato) ___ computer-go mailing list computer-go@computer-go.org http://www.computer-go.org/mailman/listinfo/computer-go/