Author: Uri Blass
Date: 09:24:35 10/27/00
Go up one level in this thread
On October 27, 2000 at 11:07:09, Jari Huikari wrote: >On October 27, 2000 at 10:31:16, Pete Galati wrote: > >>> http://www.mit.jyu.fi/~huikari/nerowb.exe (40 kB) > >>I tried it last night for the first time, but only against myself. I was quite >>sure I should have won all 3 games, but I lost them all. Sorry, but I didn't >>save the games. I didn't have any problems with the Winboard version of Nero, >>in fact it worked better than a lot of Winboard engines I've tried. > >Nice that it works. Sorry that it won the games! You must have been tired? :-) > >I guess most WB-engines are C-programs. NeroWB is a Pascal program. I didn't >need to do any setbuffer or other tricks. Just Readln for input and Writeln >for output. My source code is all in one 100kB file, which is freely available >too. http://www.mit.jyu.fi/~huikari/NEROWB.PAS Perhaps someone could find >it usable if creating another engine with Pascal language. > > Jari It can be also usable to help you to improve your program. I think after looking at the source code for some minutes that I see an idea how to do the same thing faster. You have a lot of if then if (moved=2) then posvalue:=posvalue-895 else if (moved=3) then posvalue:=posvalue-495 else if (moved=4) then posvalue:=posvalue-305 else if (moved=5) then posvalue:=posvalue-295 else if (moved=6) then posvalue:=posvalue-95 else if (moved=-2) then posvalue:=posvalue+895 else I guess from the numbers 895,495,305,295,95 that 2 means queen,3 means rook 4 and 5 means bishop and knight and 6 means pawn. I think that it is better to define an array piece[6] and to use if (moved>0) then posvalue:=posvalue-piece[moved] else posvalue:=posvalue+piece[-moved]; you may even do it with a bigger array and one command with no if by using posvalue:=posvalue-piece[moved+7] when piece[moved+7] may be negative when moved>1 You may use piece[moved] instead of piece[moved+7] if it is possible to define array of negative numbers in pascal. Uri
This page took 0 seconds to execute
Last modified: Thu, 15 Apr 21 08:11:13 -0700
Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.