Guest User

Untitled

a guest
Jan 17th, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. void strike(void) {
  2. int x, blok2;
  3.  
  4. printf("Where you want to hit?\n\n");
  5. printf("(0) blow to the head\n");
  6. printf("(1) punch in the stomach\n");
  7. printf("(2) hit in the legs\n\n");
  8. scanf("%d", &x);
  9. srand(time(0));
  10. blok2 = rand() %3;
  11. if (x == blok2) {
  12. printf("You do not hit\n\n");
  13. }
  14. else if ((x > 2) || (x < 0)){
  15. printf("*MORTAL COMBAT*\n");
  16. }
  17. else {
  18. printf("You have got! - %d HP\n\n", power);
  19. enemy_hp = enemy_hp - power;
  20. }
  21. }
Add Comment
Please, Sign In to add comment