Created
April 7, 2016 09:23
-
-
Save anonymous/51c962908e5c59b06c3d991faae8e44b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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