Created
April 14, 2022 19:44
-
-
Save mauro-balades/104a032acfb877461fb8ddde8c8d7fb8 to your computer and use it in GitHub Desktop.
Run BASIC code in c++
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
#ifndef __BASIC_CPP_H__ | |
#define __BASIC_CPP_H__ | |
#define DO { | |
#define END } | |
#define IF(x) if (x) | |
#define ELSE } else | |
#define DEFINE(T, x, v) T x = v; | |
#define GO_TO(x) goto x; | |
#define RETURN(x) return x; | |
#define FOR(x) for (x) | |
#define WHILE(x) while(x) | |
#endif /* __BASIC_CPP_H__ */ |
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 "basic.cpp" | |
int main() DO | |
DEFINE(int, i, 1) | |
WHILE(i < 10) DO | |
IF (i==5) DO | |
printf("Half way throught!\n"); | |
ELSE IF (i == 1) DO | |
printf("Start!"); | |
ELSE | |
printf("I: %i\n", i); | |
END | |
i++; | |
END | |
END |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
lol basic is bigger right?