Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <time.h>
- #include <string.h>
- int helpCommand() {
- printf(";rngNBit - Generates a random number of unsigned N Bits e.g ;rng4 will generate a number from 0-15 \n");
- };
- int rngCommand4() { // Does actions if command is ;rng4
- srand ( time(NULL) );
- int rng4Bit = rand();
- printf("%d \n", rng4Bit);
- };
- int main () {
- while(1) {
- char rngCommand[5] = ";rng4";
- char helpCommand[5] = "help";
- printf("CubeBot is currently functioning, please enter a command \n");
- scanf("%s", rngCommand);
- scanf("%s", helpCommand);
- if (strcmp(rngCommand, ";rng4") == 0) {rngCommand4();}
- else if (strcmp(helpCommand, ";help") == 0); { helpCommand();};
- }};
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement