Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream> //Input output stream
- #include <windows.h> // needed for SetConsoleTitle Function
- #include <ctime> //needed for clock function
- using namespace std; // uses the namespace std
- int main()
- {
- SetConsoleTitle( "Lose Health" ); //sets Window Title to Lose Health
- int Health = 100; //Declaring health variable
- int start = clock(); //start - some number
- cout << "Address of Health: " << &Health << endl; // Outputs address
- while(Health > 0) //while health is greater than 0
- {
- if(clock() - start > 1000) //counts down every second
- {
- start = clock(); // renew the start value
- cout << "Health: " << Health << endl; //out puts Health
- Health--; //decrements Health by 1
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment