You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

13 lines
279 B

#include <stdlib.h>
#include "ai.h"
#include "engine.h"
#include "gfx.h"
const char moves[] = {'w', 'a', 's', 'd'};
int ai_move(struct gamestate *g)
{
/* Ensure srand is called somewhere prior */
if (g->opts->interactive) gfx_sleep(50);
return moves[rand() % 4];
}