Re: checkers player
"Aaron S. Hawley" <[email protected]>
| Newsgroups | gmane.org.ballistichelmet.lambda |
|---|---|
| Organization | University of Vermont |
| Message-ID | <[email protected]> |
I don't know... I'm sort of partial to this:
BEGIN {
BOARD_SIZE = 8;
srand();
}
function random_move()
{
return int(BOARD_SIZE * 1000 * rand() + 1000);
}
/^-?[1-9][1-9][1-9][1-9]$/ {
print random_move();
}
! /^-?[1-9][1-9][1-9][1-9]$/ {
print "invalid move: " $0;
}
On Sun, 15 Feb 2004, dvanhorn wrote:
> World's best Votey Checkers player:
>
> #include <stdio.h>
>
> int main() {
> int i;
> loop:
> printf("%d%d%d%d\n", rand()%8+1,rand()%8+1,rand()%8+1,rand()%8+1);
> scanf("%d", &i);
> goto loop;
> }