Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- // atakuj //attack
- int attack(string attacker, string enemy);
- // wez_obrazenia// get_damage
- void get_damage(int damage, int &hp);
- int main()
- {
- int hp = 100;
- get_damage(attack("Gracz", "Goblin") , hp);
- cout << "HP: " << hp << endl;
- return 0;
- }
- int attack(string attacker, string enemy)
- {
- cout << attacker << " atakuje " << enemy << endl;
- return 5; // wartość ataku
- }
- void get_damage(int damage, int &hp)
- {
- hp -= damage;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement