Skip to content

Instantly share code, notes, and snippets.

/x.c

Created April 7, 2016 09:51
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/520109406c81200b96194911d2a3fa00 to your computer and use it in GitHub Desktop.
Save anonymous/520109406c81200b96194911d2a3fa00 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 rand = ACS_Random(1, 2);
int (*func)(int a);
if (rand == 1) { func = testFunc1; }
else { func = testFunc2; }
printf("ayy lmao (");
printf("%f", 0.1);
printf(")\n");
ACS_BeginPrint();
int x = ACS_Random(1, 10);
__nprintf("rand -> %d; func(%d) -> %d", rand, x, func(x));
__nprintf("\ndouble testing");
__nprintf("\n%%e: %e", 0.1f);
__nprintf("\n%%f: %f", 0.1f);
__nprintf("\n%%g: %g", 0.1f);
ACS_EndPrint();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment