Advertisement
Guest User

Untitled

a guest
Jan 4th, 2021
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.03 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h> //For the RNG
  3.  
  4. int main()
  5.  
  6. //NOTE TO SELF PRESS BUILD AND RUN
  7. //DON'T FORGET SEMI COLONS
  8.  
  9. {
  10.     //Start off by making the vars for health
  11.     int p1_health = 100;
  12.     int ai_health = 100;
  13.     //Now for damage
  14.     int ember = 5;
  15.     int inferno = 15;
  16.     int counter = 0;
  17.  
  18.     //Now to make a "UI"
  19.     printf("Hi are you ready to play? If this is your first time playing, type 'h' if you are ready to play, press 's' ");
  20.     char start_up;
  21.  
  22.     scanf("%c", &start_up);
  23.  
  24. //Game start
  25.     do{
  26. //Player one's go
  27.  
  28.         printf("You have %d HP" ,p1_health);
  29.         printf(" and the computer has %d HP\n" ,ai_health);
  30.  
  31.         printf("Choose your move: type 'e' for ember or 'i' for inferno\n");
  32.         char move;
  33.         scanf("%c", &move);
  34.         //printf("\n%c\n", move);
  35.         if(move=='e'){
  36.             int a = 5;
  37.             int b = a-2;
  38.             printf("%d", b);
  39.  
  40.  
  41.             }
  42.  
  43.  
  44.  
  45.  
  46.     }
  47.     while(p1_health > 0 || ai_health > 0);
  48.  
  49.  
  50.  
  51.     return 0;
  52. }
  53.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement