Skip to content

Instantly share code, notes, and snippets.

Created April 7, 2016 09:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/51c962908e5c59b06c3d991faae8e44b to your computer and use it in GitHub Desktop.
Save anonymous/51c962908e5c59b06c3d991faae8e44b to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ACS_Zandronum.h>
int testFunc1(int a)
{
return a + 10;
}
int testFunc2(int a)
{
return a + 110;
}
[[call("ScriptS"), address("butt")]]
void TestScript(int butt)
{
int rand = ACS_Random(1, 2);
int (*func)(int a);
if (rand == 1) { func = testFunc1; }
else { func = testFunc2; }
ACS_BeginPrint();
int x = ACS_Random(1, 10);
__nprintf("rand -> %d; func(%d) -> %d", rand, x, func(x));
ACS_EndPrint();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment