Twilight MU Online Forum

Twilight MU Online Forum (http://forum.twilightmu.com/index.php)
-   Programming Section (http://forum.twilightmu.com/forumdisplay.php?f=128)
-   -   Zen -> non-elite resets calculator. (http://forum.twilightmu.com/showthread.php?t=35510)

ozio 29-03-2010 01:17 PM

Zen -> non-elite resets calculator.
 
Zen -> Resets DOWNLOAD! v2.1
Resets -> Zen DOWNLOAD! v1.1
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

This small DOS program will calculate the reset you end up with if you use up all of your Zen. It's only for non-elite resets.

Remember to input your Zen in millions. For example: if you have "59.104.411.540 Zen in your ZenBank" you type in "59104" when it asks you for millions of Zen.

Zen to Resers: DOWNLOAD!

Code:

#include <stdio.h>
#include <iostream>

using namespace std;

int main()
{
    int zen = 0, resets = 0, start_resets = 0;
    cout<<"(1 milion = 1 000 000)\nmilions of zen: ";
    cin>>zen;
    cout<<"current resets: ";
    cin>>resets;
    if(resets > 350) resets = 350;
    start_resets = resets;
   
    cout<<"Starting with "<<resets<<" reset(s) and having "<<zen<<" milion zen you can afford ";
   
    if(zen <=0) resets++;
    while(zen > 0)
    {
              zen -= 100;                    // 100
              if (resets >  14) zen -=  150; // 250
              if (resets >  49) zen -=  100; // 350
              if (resets >  74) zen -=  150; // 500
              if (resets >  99) zen -=  250; // 750
              if (resets > 149) zen -=  250; //1000
              if (resets > 199) zen -=  500; //1500
              if (resets > 249) zen -= 1000; //2500

              resets ++;
    }
    resets --;
   
    if(resets > 350)
    {
              resets = 350;
              cout<<"(max for non-elite) ";
    }
   
    cout<<(resets - start_resets)<<" more reset(s). You will have "<<resets<<" reset(s) total.\n\n\tPress <Enter> to quit.\n";
   
    cin.ignore ( numeric_limits<streamsize>::max(), '\n' ); //clearing the input
    cin.get(); //waiting for any key
    //cin>>zen;
    //system("pause");
    return 1;
}

_______________________________________

as requested the
Resers to Zen: DOWNLOAD!

Code:

#include <stdio.h>
#include <iostream>

using namespace std;

int main()
{
    int zen = 0, start_zen=0, resets = 0, end_resets = 0;
    cout<<"Resets you have: ";
    cin>>resets;
    if(resets > 350) {resets = 350; cout<<"The maximum of non-elite resets you can have is 350!\nIf you have elite resets this program is not for you.\n\n";}
    cout<<"Resets you want: ";
    cin>>end_resets;
    if(end_resets > 350) {end_resets = 350; cout<<"The maximum of non-elite resets you can have is 350!\n\n";}
    cout<<"(1 milion = 1 000 000)\nMilions of zen you have: ";
    cin>>start_zen;
   
    cout<<"Starting with "<<resets<<" reset(s) you need ";

    while(end_resets > resets)
    {
              zen += 100;                    // 100
              if (resets >  14) zen +=  150; // 250
              if (resets >  49) zen +=  100; // 350
              if (resets >  74) zen +=  150; // 500
              if (resets >  99) zen +=  250; // 750
              if (resets > 149) zen +=  250; //1000
              if (resets > 199) zen +=  500; //1500
              if (resets > 249) zen += 1000; //2500

              resets ++;
    }

    if(zen<start_zen)start_zen=zen;
   
    cout<<(zen-start_zen)<<" milion zen to get to "<<end_resets<<" reset(s).\nTotal milions of zen required: "<<zen<<"\n\n\tPress <Enter> to quit.\n";
   
    cin.ignore ( numeric_limits<streamsize>::max(), '\n' ); //clearing the input
    cin.get(); //waiting for any key
    return 1;
}

_______________________________________

old zen 2 resets (v1.0)

Code:

#include <stdio.h>
#include <iostream>

using namespace std;

int main()
{
    int zen = 0, resets =0;
    cout<<"milions of zen: ";
    cin>>zen;
    cout<<"current resets: ";
    cin>>resets;
   
    cout<<"Starting with "<<resets<<" reset(s) and having "<<zen<<" milion zen you can afford to go to ";
   
    if(zen <=0) resets++;
    while(zen > 0)
    {

              zen -= 100;                    // 100
              if (resets >  14) zen -=  150; // 250
              if (resets >  49) zen -=  100; // 350
              if (resets >  74) zen -=  150; // 500
              if (resets >  99) zen -=  250; // 750
              if (resets > 149) zen -=  250; //1000
              if (resets > 199) zen -=  500; //1500
              if (resets > 249) zen -= 1000; //2500


              resets ++;
    }
    resets --;
   
    if(resets > 350)
    {
              resets = 350;
              cout<<" (max for non-elite) ";
    }
   
    cout<<resets<<" reset(s).\n";
   
    cin.ignore ( numeric_limits<streamsize>::max(), '\n' ); //clearing the input
    cin.get(); //waiting for any key
    //cin>>zen;
    //system("pause");
    return 1;
}


Shock3X 29-03-2010 01:27 PM

little ss, really great program!

(notice: tells what rr is max u can get [106=>110, not 4]) lol this blonde had to think about it pretty long

http://forum.twilightmuonline.com/im...0f09b39ccc.png

ozio 29-03-2010 01:33 PM

Maybe I should make ver. 2 for the "blondes". :P

Shock3X 29-03-2010 02:01 PM

yeah, that would be great, also ya could make option how much zen u need to make x amount of rrs?

ozio 30-03-2010 02:03 AM

I'm not sure if I should start another thread for resets to zen converter :P

Anyway ver. 2 is now done.

Judobreaker 30-03-2010 03:31 AM

Hmm...
Isn't dos completely unsupported in Vista and Win7?
I'm 100% sure Win7 dropped all dos support. :P
If you want a real 'blondes' version you should make a normal exe file cause the chances a 'blonde' buys a random pc which happens to have Win7 on it are rather large... :P

ozio 30-03-2010 03:43 AM

Did you test it on win7? It might work, or it might work in compatibility mode.

Shock3X obviously managed to run on on vista.

Anyway, the source code is there. Get a c++ compiler for Win7, compile it and run it.

Smile 30-03-2010 04:47 AM

can u explain about the ver2?
and thanks for the program good one!

Shock3X 30-03-2010 05:12 AM

Quote:

Originally Posted by ozio (Post 225661)
Did you test it on win7? It might work, or it might work in compatibility mode.

Shock3X obviously managed to run on on vista.

Anyway, the source code is there. Get a c++ compiler for Win7, compile it and run it.

I used win7 without noprobs, just ran it. Didnt even ask anything

ozio 30-03-2010 05:46 AM

Quote:

Originally Posted by Smile (Post 225663)
can u explain about the ver2?
and thanks for the program good one!

Ver. 2 simply makes it clearer. It works the same but (unlike ver. 1) it gives you how many more resets can you get.


All times are GMT -5. The time now is 02:42 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright ©2006 - 2019 Twilight MU. All Rights Reserved