Sythe.Org Forums     Register     FAQ     Members List     Calendar     Mark Forums Read    
 
Sythe.Org Forums  
   Runescape Gold

Sythe.org — A Virtual Goods Trading Hub

Make real cash! buying and selling in-game items.

We have a no-scam policy.

You can make thousands playing your favourite games here at Sythe.org.

Just sign up an account and follow the rules!


Take me to

Runescape Markets

Other Game Markets

Support Center

Register an Account

Close
Potion Decant Calculator
Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 05-29-2012, 11:36 PM
T7 Press 7T's Avatar
Forum Addict
 
Join Date: Jun 2007
Posts: 384
Send a message via MSN to T7 Press 7T
Default Potion Decant Calculator

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()".
__________________



Last edited by T7 Press 7T : 05-30-2012 at 12:35 AM.
Reply With Quote
  #2  
Old 09-07-2012, 07:28 PM
Fox.'s Avatar
Forum Addict
$5 USD Donor New
 
Join Date: Aug 2011
Posts: 295
Default Re: Potion Decant Calculator

Quote:
Originally Posted by T7 Press 7T View Post
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()".
Try flushing the cin buffer at the end.

Code:
cin.ignore(std::numeric_limits<std::streamsize>::max());
cin.get();
return 0;

Last edited by Fox. : 09-07-2012 at 07:29 PM.
Reply With Quote
  #3  
Old 10-04-2012, 10:25 PM
Blupig's Avatar
i am a guy ok?? -.-
Ex-Moderator Zombie Visual Basic Programmers
 
Join Date: Nov 2006
Location: Canada
Posts: 5,241
Send a message via MSN to Blupig Send a message via Skype™ to Blupig
MushyMuncher
Default Re: Potion Decant Calculator

+1 on using iostream, it's so painful when I see people using c functions like printf in C++
__________________
if your parts of the 70% of the site
put this in your sig
Reply With Quote
Reply



Cheap RS Gold Store  Runescape Gold

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

All times are GMT +1. The time now is 05:26 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.6.1