Add the ai files that were forgotten in previous commit

This commit is contained in:
Tiehuis 2015-02-25 14:53:49 +13:00
parent cf1a147078
commit 1da480b331
2 changed files with 18 additions and 0 deletions

10
src/ai.c Normal file
View File

@ -0,0 +1,10 @@
#include "ai.h"
#include "engine.h"
const char moves[] = {'w', 'a', 's', 'd'};
int ai_move(struct gamestate *g)
{
if (g->opts->interactive) usleep(50000);
return moves[rand() % 4];
}

8
src/ai.h Normal file
View File

@ -0,0 +1,8 @@
#ifndef AI_H
#define AI_H
#include "engine.h"
int ai_move(struct gamestate *g);
#endif