Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void show() {
- char zeroHp[3] = ""; zeroHp[2] = '\0';
- char zeroEn[3] = ""; zeroEn[2] = '\0';
- char zeroIq[3] = ""; zeroIq[2] = '\0';
- char zeroSa[3] = ""; zeroSa[2] = '\0';
- char zeroEx[3] = ""; zeroEx[2] = '\0';
- for(int i = 0; i < 2; ++i) {
- if(log10(hp)+1 < 3 - i) zeroHp[i] = '0';
- if(log10(iq)+1 < 3 - i) zeroIq[i] = '0';
- if(log10(sanity)+1 < 3 - i) zeroSa[i] = '0';
- if(log10(energy)+1 < 3 - i) zeroEn[i] = '0';
- if(log10(excitement)+1 < 3 - i) zeroEx[i] = '0';
- }
- cout << name << " " << surname << ": ";
- cout << "HP = " << zeroHp << hp << ", ";
- cout << "Energy = " << zeroEn << energy << ", ";
- cout << "IQ = " << zeroIq << iq << ", ";
- cout << "Sanity = " << zeroSa << sanity << ", ";
- cout << "Excitement = " << zeroEx << excitement << ".";
- if(is_alive())
- cout << '\n';
- else
- cout << " Game over." << '\n';
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement