joeyagi/tests/agiHost.c
2026-10-06 16:59:41 -05:00

28 lines
703 B
C

// agiHost: JoeyAGI on the build machine, played by an input script.
//
// agiHost SCRIPT OUTDIR run from a folder holding DATA/ with the game;
// OUTDIR "-" prints the shots' hashes only
//
// The interpreter's own main is compiled as agiMain (-Dmain=agiMain).
#include "hostPort.h"
#include <stdio.h>
int agiMain(int argc, char **argv);
int main(int argc, char **argv) {
char *agiArgv[1];
if (argc != 3) {
fprintf(stderr, "usage: agiHost SCRIPT OUTDIR (run from a folder holding DATA/)\n");
return 2;
}
if (!hostScriptOpen(argv[1], argv[2])) {
return 2;
}
agiArgv[0] = argv[0];
return agiMain(1, agiArgv);
}