[c++] Exp list

01/17/2011 18:39 One Tap#1
I made this a while ago don't know if till the same exp calculation

Code:
const int LevelM1 =	33;	
const int LevelM2 =	165;	
const int LevelM3 =	178;	
const int LevelM4 =	347;	
const int LevelM5 =	627;	
const int LevelM6 =	990;	
const int LevelM7 =	1183;	
const int LevelM8  =    2407;	
const int LevelM9  =	3679;	
const int LevelM10 =	8341;	
const int LevelM11 =	11996;	
const int LevelM12 =	14429;	
const int LevelM13 =	18043;	
const int LevelM14 =	21612;	
const int LevelM15 =	22596;	
const int LevelM16 =	32217;	
const int LevelM17 =	37480;	
const int LevelM18 =	47573;	
const int LevelM19 =	56704;	
const int LevelM20 =	68789;	
const int LevelM21 =	70451;	
const int LevelM22 =	75923;	
const int LevelM23 =	97776;	
const int LevelM24 =	114826;	
const int LevelM25 =	120892;	
const int LevelM26 =	123980;	
const int LevelM27 =	126799;	
const int LevelM28 =	145811;	
const int LevelM29 =	173384;	
const int LevelM30 =	197651;	
const int LevelM31 =	202490;	
const int LevelM32 =	212172;	
const int LevelM33 =	244204;	
const int LevelM34 =	285805;	
const int LevelM35 =	305949;	
const int LevelM36 =	312881;	
const int LevelM37 =	324575;	
const int LevelM38 =	366153;	
const int LevelM39 =	434023;	
const int LevelM40 =	460573;	
const int LevelM41 =	506713;	
const int LevelM42 =	570008;	
const int LevelM43 =	728546;	
const int LevelM44 =	850828;	
const int LevelM45 =	916402;	
const int LevelM46 =	935051;	
const int LevelM47 =	940860;	
const int LevelM48 =	1076590;	
const int LevelM49 =	1272807;	
const int LevelM50 =	1357986;	
const int LevelM51 =	1384873;	
const int LevelM52 =	1478420;	
const int LevelM53 =	1632489;	
const int LevelM54 =	1903121;	
const int LevelM55 =	2065957;	
const int LevelM56 =	2104909;	
const int LevelM57 =	1921149;	
const int LevelM58 =	2417153;	
const int LevelM59 =	2853501;	
const int LevelM60 =	3054580;	
const int LevelM61 =	3111200;	
const int LevelM62 =	3225607;	
const int LevelM63 =	3811037;	
const int LevelM64 =	4437965;	
const int LevelM65 =	4880615;	
const int LevelM66 =	4970959;	
const int LevelM67 =	5107243;	
const int LevelM68 =	5652526;	
const int LevelM69 =	6579184;	
const int LevelM70 =	6878005;	
const int LevelM71 =	7100739;	
const int LevelM72 =	7157642;	
const int LevelM73 =	9106931;	
const int LevelM74 =	10596415;	
const int LevelM75 =	11220485;	
const int LevelM76 =	11409179;	
const int LevelM77 =	11424043;	
const int LevelM78 =	12882966;	
const int LevelM79 =	15172842;	
const int LevelM80 =	15896985;	
const int LevelM81 =	16163738;	
const int LevelM82 =	16800069;	
const int LevelM83 =	19230324;	
const int LevelM84 =	22365189;	
const int LevelM85 =	23819291;	
const int LevelM86 =	24219524;	
const int LevelM87 = 	24864054;	
const int LevelM88 =	27200095;	
const int LevelM89 =	32033236;	
const int LevelM90 =	33723786;	
const int LevelM91 =	34291244;	
const int LevelM92 =	34944017;	
const int LevelM93 =	39463459;	
const int LevelM94 =	45878550;	
const int LevelM95 =	48924263;	
const int LevelM96 =	49729242;	
const int LevelM97 =	51072047;	
const int LevelM98 =	55808382;	
const int LevelM99 =	64870117;	
const int LevelM100 =	68391872;	
const int LevelM101 =	69537082;	
const int LevelM102 =	76422949;	
const int LevelM103 =	96950832;	
const int LevelM104 =	112676761;	
const int LevelM105 =	120090440;	
const int LevelM106 =	121798300;	
const int LevelM107 =	127680095;	
const int LevelM108 =	137446904;	
const int LevelM109 =	193716061;	
const int LevelM110 =	408832135;	
const int LevelM111 =	454674621;	
const int LevelM112 =	461125840;	
const int LevelM113 =	469189848;	
const int LevelM114 =	477253857;	
const int LevelM115 =	480479444;	
const int LevelM116 =	485317884;	
const int LevelM117 =	493381812;	
const int LevelM118 =	580579979;	
const int LevelM119 =	717424993;	
const int LevelM120 =	282274071;	
const int LevelM121 =	338728845;	
const int LevelM122 =	406474656;	
const int LevelM123 =	487769554;	
const int LevelM124 =	585323469;	
const int LevelM125 =	702388103;	
const int LevelM126 =	842865806;	
const int LevelM127 =	1011439064;	
const int LevelM128 =	1073741808;	
const int LevelM129 =	1073741759;	
const int LevelM130 =	8575514976;	
const int LevelM131 =	25726544928;	
const int LevelM132 =	77179634784;	
const int LevelM133 =	231538904352;	
const int LevelM134 =	694616713056;	
const int LevelM135 =	2083850139168;	
const int LevelM136 =	6251550417504;
01/18/2011 17:14 ChingChong23#2
YUCK
01/18/2011 19:07 Syst3m_W1z4rd#3
I got one thing on this.
It isn't really c++, since this would work in c# also.
If you putted it inside a class or something, then you could call it c++, but since isjust a list of variables, then it's not really c++.
01/18/2011 20:52 gabrola#4
Quote:
Originally Posted by Syst3m_W1z4rd View Post
I got one thing on this.
It isn't really c++, since this would work in c# also.
If you putted it inside a class or something, then you could call it c++, but since isjust a list of variables, then it's not really c++.
Does is it matter?
01/18/2011 21:36 One Tap#5
Quote:
Originally Posted by Syst3m_W1z4rd View Post
I got one thing on this.
It isn't really c++, since this would work in c# also.
If you putted it inside a class or something, then you could call it c++, but since isjust a list of variables, then it's not really c++.
actually i'm not famillar with c# so i wouldn't know ;)
01/18/2011 22:43 Syst3m_W1z4rd#6
Quote:
Originally Posted by gabrola View Post
Does is it matter?
Ya it does matter, I expected some c++ code, then it was just variables, but in the end it dosn't matter.
01/19/2011 06:36 .Kinshi#7
No it doesn't matter.

And this is the worst way to store required experience.
Just horrible.
01/19/2011 16:05 One Tap#8
Quote:
Originally Posted by .Kinshi View Post
No it doesn't matter.

And this is the worst way to store required experience.
Just horrible.
I don't care..

there would be alot of other ways like in a Enum etc
it's just to show
01/19/2011 16:54 IAmHawtness#9
Quote:
Originally Posted by marijn1 View Post
I don't care..

there would be alot of other ways like in a Enum etc
it's just to show
Enum would be kinda the same.. Why not initialize it in an array? Then you could do something like

If Character.CurrentExperience >= ExperienceNeeded(Character.Level) ..........
01/19/2011 17:22 Ian*#10
Yea the [C++] tag on the thread title is a bit misleading, the list i think will be the more useful part than the code itself.

and there's nothing really wrong with storing it like this, its not like you have to store it in a vector or an enum to be perfect.
01/19/2011 18:37 One Tap#11
Quote:
Originally Posted by IAmHawtness View Post
Enum would be kinda the same.. Why not initialize it in an array? Then you could do something like

If Character.CurrentExperience >= ExperienceNeeded(Character.Level) ..........
This is advice what i need(y)
01/19/2011 21:21 .Kinshi#12
Quote:
Originally Posted by Ian* View Post
Yea the [C++] tag on the thread title is a bit misleading, the list i think will be the more useful part than the code itself.

and there's nothing really wrong with storing it like this, its not like you have to store it in a vector or an enum to be perfect.
Yes, there is everything wrong with storing it like this! A enum would be just as bad, and a vector is overkill.

If you wanted to get how much exp required with this, you would have to do something like this:
Code:
switch (Character.Level)
{
    case 1: return LevelM1;
    case 2: return LevelM2;
    ...
}
That's a lot of code.


If you put it in an array, it would require just one line to get the required exp.

Code:
long reqExp = ReqExpArray[Character.Level];
01/19/2011 21:34 KraHen#13
Just use a union instead of an enum...
01/19/2011 21:43 Nullable#14
Quote:
Originally Posted by .Kinshi View Post
Yes, there is everything wrong with storing it like this! A enum would be just as bad, and a vector is overkill.

If you wanted to get how much exp required with this, you would have to do something like this:
Code:
switch (Character.Level)
{
    case 1: return LevelM1;
    case 2: return LevelM2;
    ...
}
That's a lot of code.


If you put it in an array, it would require just one line to get the required exp.

Code:
long reqExp = ReqExpArray[Character.Level];
A vector is simply a wrapped up version of C arrays, it's analogous to your array suggestion, also an enum won't consume memory unlike his const ints unless he attributes them as static const.

Quote:
Originally Posted by KraHen View Post
Just use a union instead of an enum...
Can't be done, union's members share the same memory region, simply put, all those ints will be sharing the same place, thus the same values.
Plus you can't initialize members of a union unless they are declared as static const, which doesn't really differ from an enum.
01/20/2011 03:38 gabrola#15
I like how you're arguing about how to store the list.