Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- void human()
- {
- int human_dmg = 30, *hdmg;
- int human_health = 150, *hhp;
- hdmg = &human_dmg;
- hhp = &human_health;
- }
- void goblin()
- {
- int goblin_dmg = 20, *gdmg;
- int goblin_health = 100, *ghp;
- gdmg = &goblin_dmg;
- ghp = &goblin_health;
- }
- int main()
- {
- char in[24];
- printf("Hey, welcome to the world grunt.\n if you'd like some help the just type <help>.\nOr you can just type go to start playing!\n");
- scanf("%s", &in);
- if (strcmp(in, "help")==0||strcmp(in, "Help")==0||strcmp(in, "HELP")==0)
- {
- printf("Commands: <attack>, <defend>\n");
- }
- else if (strcmp(in, "go")==0||strcmp(in, "Go")||strcmp(in, "GO"))
- {
- printf("Hello there champ you were just walking down the street when a goblin jumped out of the bushes, what would you like to do?\n");
- printf("You have %d health and %d damage, the goblin has %d health and %d damage!\n would you like to attack?\n",
- *hhp, *hdmg, *ghp, *gdmg);
- scanf("%s",in);
- if (strcmp(in, "attack")==0)
- }
- else
- printf("Invalid command!\n");
- getchar();
- getchar();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement