Re: checkers player

"Aaron S. Hawley" <[email protected]>
Newsgroups gmane.org.ballistichelmet.lambda
Organization University of Vermont
Message-ID <[email protected]>
On Sun, 15 Feb 2004, Aaron S. Hawley wrote:

> I don't know... I'm sort of partial to this:

actually the C version was more correct.

> BEGIN {
> 	BOARD_SIZE = 8;
> 	srand();
> }
>
> function random_move()
> {
> 	return int(BOARD_SIZE * 1000 * rand() + 1000);
 	return int(BOARD_SIZE* rand()) + 1 "" \
	       int(BOARD_SIZE* rand()) + 1 "" \
	       int(BOARD_SIZE* rand()) + 1 "" \
	       int(BOARD_SIZE* rand()) + 1;
> }
>
> /^-?[1-9][1-9][1-9][1-9]$/ {
> 	print random_move();
> }
>
> ! /^-?[1-9][1-9][1-9][1-9]$/ {
> 	print "invalid move: " $0;
> }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.