For whatever reason this morning I felt the need to use a potion decant calculator and couldn't find one so I made one. At the time I didn't know the formula:
Code:
potionAmount * .75 = fullPotions;
so I just made my own way to do it.
This one counts the empty and other filled vial types.
Screen:

Scan:
http://virusscan.jotti.org/en/scanre...933a2a79ac00ab
File:
http://www.sendspace.com/file/fzohe4
Code:
#include <iostream>
using namespace std;
int main() {
int potAmount;
int counter = 0;
int pot4 = 0, pot3, pot2 = 0, pot1 = 0, pot0 = 0, currPot = 3;
cout << "Please enter the total potion amount: ";
cin >> potAmount;
pot3 = potAmount;
for ( int loop = 0; loop < potAmount; loop++ ) {
switch (currPot) {
case 3:
currPot--;
pot4++;
pot3--;
pot2++;
break;
case 2:
currPot--;
pot4++;
pot2--;
pot1++;
break;
case 1:
currPot--;
pot4++;
pot1--;
break;
case 0:
currPot = 3;
pot0++;
break;
}
}
cout << "You have " << pot4 << " 4 dose potions." << endl;
cout << "You have " << pot2 << " 2 dose potions." << endl;
cout << "You have " << pot1 << " 1 dose potions." << endl;
cout << "You have " << pot0 << " empty vials" << endl;
system("pause");
return 0;
}
I'm fully aware "system("pause");" is pretty lame, but Visual Studio isn't letting me pause any other way; even with simple "cin.get()".