Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* This program attempts to calculate the total number of possible gag combinations on toontown. For now, the program assumes no cogs are already lured (This would change if it was possible to use a trap gag). The major complexity of the project revolves around eliminating the duplicate cases of multi hit attacks. Assumption: Using a multi hit gag on 2 or more cogs only counts as one move.
- @author Steve /u/cardinalfan828
- */
- #include <iostream>
- #include <math.h>
- using namespace std;
- class Toontastic
- {
- public:
- Toontastic();
- void oneToon();
- void twoToons();
- void threeToons();
- void fourToons();
- int getT();
- void addT(int);
- private:
- int grandTotal;
- };
- int main()
- {
- cout << "This program attempts to output the number of possible gag combinations in toontown." << endl;
- cout << "\nAssumptions:\n\tA toon can not toon themselves up." << endl;
- cout << "\tUsing multiple traps on the same cog counts as a valid combination. \n\t\tLikewise, using lure and drop together is also valid." << endl;
- cout << "\tBasic Formula:" << endl;
- cout << "\t\tToonsinBattleCogsInBattle = (SingleHitGags * cogs) + multiHitGags + \n\t\t(SingleHitToonup * (ToonsInBattle - 1)) + MultiHitToonup " << endl;
- cout << "\tThe first two variables only keep track of single and multi hit gags exculding toon-up." << endl;
- cout << "\tWhen one toon is in battle, the 2 toon-up variables are ignored.\n" << endl;
- Toontastic flippy;
- flippy.Toontastic::oneToon();
- flippy.Toontastic::twoToons();
- flippy.Toontastic::threeToons();
- flippy.Toontastic::fourToons();
- return 0;
- }
- Toontastic::Toontastic()
- {
- grandTotal = 0;
- }
- int Toontastic::getT()
- {
- return grandTotal;
- }
- void Toontastic::addT(int part)
- {
- grandTotal += part;
- }
- void Toontastic::oneToon()
- {
- /*multi hit gags will only count 1 way not n ways for n cogs in the battle. These are: 4 toon up gags, 4 lure gags, all (7) sound gags, 1 throw gag, 1 squirt gag, and 1 drop gag.
- 4 Toon Up
- 4 Lure
- 7 Sound
- 1 Throw
- 1 Squirt
- 1 Drop
- 18 Total Multi Hit Gags
- 31 Total Single Hit Gags
- 14 Total for 1 toon when not counting toon up.
- 24 Total for 1 toon when not counting toon up.
- 42 non toon up gags
- 7 toon up gags
- */
- int toons = 1;
- const int tot = 49;
- const int mH = 18;
- const int sH = 24;
- const int tuS = 3;
- const int tuM = 4;
- int cogs = 0;
- int t1 = 0;
- int t1c1 = 0;
- int t1c2 = 0;
- int t1c3 = 0;
- int t1c4 = 0;
- cogs = 1; //one cog
- t1c1 = (sH * cogs) + mH;
- t1c1 = t1c1 * t1c1;
- cout << "Combos with " << toons << " toon " << "and " << cogs << " cog: " << t1c1 << endl;
- cogs = 2; //two cogs
- t1c2 = (sH * cogs) + mH;
- t1c2 = t1c2 * t1c2; // for each one, other can chose all of their choices
- cout << "Combos with " << toons << " toon " << "and " << cogs << " cogs: " << t1c2 << endl;
- cogs = 3; //three cogs
- t1c3 = (sH * cogs) + mH;
- t1c3 = t1c3 * t1c3;
- cout << "Combos with " << toons << " toon " << "and " << cogs << " cogs: " << t1c3 << endl;
- cogs = 4; //four cogs
- t1c4 = (sH * cogs) + mH;
- t1c4 = t1c4 * t1c4;
- cout << "Combos with " << toons << " toon " << "and " << cogs << " cogs: " << t1c4 << endl;
- cout << "\n";
- t1 = t1c1 + t1c2 + t1c3 + t1c4; //adds cog subtotals to subtotal of for 2 toons
- cout << "The total possible combinations of gags with 2 toons: " << t1 << endl;
- addT(t1); //adds partial of all of 2 toons to the grand total
- cout << "The grand total of combinations is: " << Toontastic::getT() << "\n" << endl;
- }
- void Toontastic::twoToons()
- {
- /*multi hit gags will only count 1 way not n ways for n cogs in the battle. These are: 4 toon up gags, 4 lure gags, all (7) sound gags, 1 throw gag, 1 squirt gag, and 1 drop gag.
- 4 Toon Up
- 4 Lure
- 7 Sound
- 1 Throw
- 1 Squirt
- 1 Drop
- 18 Total Multi Hit Gags, 14 Total for 1 toon when not counting toon up.
- 31 Total Single Hit Gags, 24 Total for 1 toon when not counting toon up.
- 42 non toon up gags
- 7 toon up gags
- */
- int toons = 2;
- const int tot = 49;
- const int mH = 18;
- const int sH = 24;
- const int tuS = 3;
- const int tuM = 4;
- int cogs = 0;
- int t2 = 0;
- int t2c1 = 0;
- int t2c2 = 0;
- int t2c3 = 0;
- int t2c4 = 0;
- cogs = 1; //one cog
- t2c1 = (sH * cogs) + mH + (tuS * (toons - 1)) + tuM;
- t2c1 = t2c1 * t2c1;
- cout << "Combos with " << toons << " toons " << "and " << cogs << " cog: " << t2c1 << endl;
- cogs = 2; //two cogs
- t2c2 = (sH * cogs) + mH + (tuS * (toons - 1)) + tuM;
- t2c2 = t2c2 * t2c2; // for each one, other can chose all of their choices
- cout << "Combos with " << toons << " toons " << "and " << cogs << " cogs: " << t2c2 << endl;
- cogs = 3; //three cogs
- t2c3 = (sH * cogs) + mH + (tuS * (toons - 1)) + tuM; //total for 1 person
- t2c3 = t2c3 * t2c3;
- cout << "Combos with " << toons << " toons " << "and " << cogs << " cogs: " << t2c3 << endl;
- cogs = 4; //four cogs
- t2c4 = (sH * cogs) + mH + (tuS * (toons - 1)) + tuM;
- t2c4 = t2c4 * t2c4;
- cout << "Combos with " << toons << " toons " << "and " << cogs << " cogs: " << t2c4 << endl;
- cout << "\n";
- t2 = t2c1 + t2c2 + t2c3 + t2c4; //adds cog subtotals to subtotal of for 2 toons
- cout << "The total possible combinations of gags with 2 toons: " << t2 << endl;
- addT(t2); //adds partial of all of 2 toons to the grand total
- cout << "The grand total of combinations is: " << Toontastic::getT() << "\n" << endl;
- }
- void Toontastic::threeToons()
- {
- /*multi hit gags will only count 1 way not n ways for n cogs in the battle. These are: 4 toon up gags, 4 lure gags, all (7) sound gags, 1 throw gag, 1 squirt gag, and 1 drop gag.
- 4 Toon Up
- 4 Lure
- 7 Sound
- 1 Throw
- 1 Squirt
- 1 Drop
- 18 Total Multi Hit Gags, 14 Total for 1 toon when not counting toon up.
- 31 Total Single Hit Gags, 24 Total for 1 toon when not counting toon up.
- 42 non toon up gags
- 7 toon up gags
- */
- int toons = 3;
- const int tot = 49;
- const int mH = 18;
- const int sH = 24;
- const int tuS = 3;
- const int tuM = 4;
- int cogs = 0;
- int t3 = 0;
- int t3c1 = 0;
- int t3c2 = 0;
- int t3c3 = 0;
- int t3c4 = 0;
- cogs = 1; //one cog
- t3c1 = (sH * cogs) + mH + (tuS * (toons - 1)) + tuM;
- t3c1 = t3c1 * t3c1 * t3c1;
- cout << "Combos with " << toons << " toons " << "and " << cogs << " cog: " << t3c1 << endl;
- cogs = 2; //two cogs
- t3c2 = (sH * cogs) + mH + (tuS * (toons - 1)) + tuM;
- t3c2 = t3c2 * t3c2 * t3c2; // for each one, other can chose all of their choices
- cout << "Combos with " << toons << " toons " << "and " << cogs << " cogs: " << t3c2 << endl;
- cogs = 3; //three cogs
- t3c3 = (sH * cogs) + mH + (tuS * (toons - 1)) + tuM; //total for 1 person
- t3c3 = t3c3 * t3c3 * t3c3;
- cout << "Combos with " << toons << " toons " << "and " << cogs << " cogs: " << t3c3 << endl;
- cogs = 4; //four cogs
- t3c4 = (sH * cogs) + mH + (tuS * (toons - 1)) + tuM;
- t3c4 = t3c4 * t3c4 * t3c4;
- cout << "Combos with " << toons << " toons " << "and " << cogs << " cogs: " << t3c4 << endl;
- cout << "\n";
- t3 = t3c1 + t3c2 + t3c3 + t3c4; //adds cog subtotals to subtotal of for 2 toons
- cout << "The total possible combinations of gags with 3 toons: " << t3 << endl;
- addT(t3); //adds partial of all of 2 toons to the grand total
- cout << "The grand total of combinations is: " << Toontastic::getT() << "\n" << endl;
- }
- void Toontastic::fourToons()
- {
- /*multi hit gags will only count 1 way not n ways for n cogs in the battle. These are: 4 toon up gags, 4 lure gags, all (7) sound gags, 1 throw gag, 1 squirt gag, and 1 drop gag.
- 4 Toon Up
- 4 Lure
- 7 Sound
- 1 Throw
- 1 Squirt
- 1 Drop
- 18 Total Multi Hit Gags, 14 Total for 1 toon when not counting toon up.
- 31 Total Single Hit Gags, 24 Total for 1 toon when not counting toon up.
- 42 non toon up gags
- 7 toon up gags
- */
- int toons = 4;
- const int tot = 49;
- const int mH = 18;
- const int sH = 24;
- const int tuS = 3;
- const int tuM = 4;
- int cogs = 0;
- int t4 = 0;
- int t4c1 = 0;
- int t4c2 = 0;
- int t4c3 = 0;
- int t4c4 = 0;
- cogs = 1; //one cog
- t4c1 = (sH * cogs) + mH + (tuS * (toons - 1)) + tuM;
- t4c1 = t4c1 * t4c1 * t4c1 * t4c1;
- cout << "Combos with " << toons << " toons " << "and " << cogs << " cog: " << t4c1 << endl;
- cogs = 2; //two cogs
- t4c2 = (sH * cogs) + mH + (tuS * (toons - 1)) + tuM;
- t4c2 = t4c2 * t4c2 * t4c2 * t4c2; // for each one, other can chose all of their choices
- cout << "Combos with " << toons << " toons " << "and " << cogs << " cogs: " << t4c2 << endl;
- cogs = 3; //three cogs
- t4c3 = (sH * cogs) + mH + (tuS * (toons - 1)) + tuM; //total for 1 person
- t4c3 = t4c3 * t4c3 * t4c3 * t4c3;
- cout << "Combos with " << toons << " toons " << "and " << cogs << " cogs: " << t4c3 << endl;
- cogs = 4; //four cogs
- t4c4 = (sH * cogs) + mH + (tuS * (toons - 1)) + tuM;
- t4c4 = t4c4 * t4c4 * t4c4 * t4c4;
- cout << "Combos with " << toons << " toons " << "and " << cogs << " cogs: " << t4c4 << endl;
- cout << "\n";
- t4 = t4c1 + t4c2 + t4c3 + t4c4; //adds cog subtotals to subtotal of for 2 toons
- cout << "The total possible combinations of gags with 4 toons: " << t4 << endl;
- addT(t4); //adds partial of all of 2 toons to the grand total
- cout << "The grand total of combinations is: " << Toontastic::getT() << "\n" << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement