Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.10 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. void human()
  5. {
  6.     int human_dmg = 30, *hdmg;
  7.     int human_health = 150, *hhp;
  8.     hdmg = &human_dmg;
  9.     hhp = &human_health;
  10. }
  11.  
  12. void goblin()
  13. {
  14.     int goblin_dmg = 20, *gdmg;
  15.     int goblin_health = 100, *ghp;
  16.  
  17.     gdmg = &goblin_dmg;
  18.     ghp = &goblin_health;
  19. }
  20.  
  21. int main()
  22. {
  23.  
  24.     char in[24];
  25.  
  26.     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");
  27.  
  28.     scanf("%s", &in);
  29.  
  30.     if (strcmp(in, "help")==0||strcmp(in, "Help")==0||strcmp(in, "HELP")==0)
  31.     {
  32.         printf("Commands: <attack>, <defend>\n");
  33.     }
  34.     else if (strcmp(in, "go")==0||strcmp(in, "Go")||strcmp(in, "GO"))
  35.     {
  36.         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");
  37.         printf("You have %d health and %d damage, the goblin has %d health and %d damage!\n would you like to attack?\n",
  38.             *hhp, *hdmg, *ghp, *gdmg);
  39.         scanf("%s",in);
  40.         if (strcmp(in, "attack")==0)
  41.     }
  42.     else
  43.         printf("Invalid command!\n");
  44.  
  45.  
  46.     getchar();
  47.     getchar();
  48.     return 0;
  49.  
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement