Welcome to Gaia! ::

And prepare to read the worst spaghetti code you have ever seen

link

4057 lines of absolute crap. Unindented, and with some of the worst programming practices ever conceivable. Kudos to the writer for managing to avoid goto in all of this:

Highlights include:

for(ii = 0; ii < 1; ii++)


// new averaging system
float pp;
float x;
float xx;
float xxx;
float xxxx;
float xxxxx;
float xxxxxx;
float xxxxxxx;
float xxxxxxxx;
float xxxxxxxxx;
float xxxxxxxxxx;
float xxxxxxxxxxx;
float xxxxxxxxxxxx;
float xxxxxxxxxxxxx;
float xxxxxxxxxxxxxx;
float xxxxxxxxxxxxxxx;
float xxxxxxxxxxxxxxxx;
float xxxxxxxxxxxxxxxxx;
float xxxxxxxxxxxxxxxxxx;
float xxxxxxxxxxxxxxxxxxx;
float xxxxxxxxxxxxxxxxxxxx;


Writing cout << endl; 27 times in a row, each being given a separate line....

And much more.
Trying to decide of that programmer is:
1)A troll
2)Stupid
3)Bad Programmer
4)High
5)Drunk
6)All of the above.

Can somebody explain to me why people use single letters for variable names, I've always been under the impression that it is good practice the have the name relate to its purpose.
Disconsented
Trying to decide of that programmer is:
1)A troll
2)Stupid
3)Bad Programmer
4)High
5)Drunk
6)All of the above.

Can somebody explain to me why people use single letters for variable names, I've always been under the impression that it is good practice the have the name relate to its purpose.


For a quick throwaway variable that you're only going to use once, it's sometimes okay to use a single letter. For example, when I'm writing Ruby, I like to use the letters i, o, or e in blocks for variables that will be serving as iterators.

Example:
["Hello", " ", "World", "n"].each { |e| print e }

Because the scope is limited and I can generally accept "e" to mean "element", I don't bother to add anything else.

For variables with any semblance of meaning, however, giving them a proper name is generally wise.

In any case, I'm going to go with "troll" for what you're wondering he was. Because really, what kind of person makes a for loop that only executes once.
CHED WAWDEN's avatar

Gaian

OH DEAR LORD WHAT THE HELL IS THAT CRAP

Another highlight:
I love the "Random number" output.
This guy's never heard of for, evidently, or doesn't know how to use it. lol


// RANDOM NUMBER DECLARATION
void Math::Rando()
{
int xn;
do
{
int pi;
int phi;
int o;
int ii;
int ddd;
cout<<endl;
cout<<"======================="<<endl;
cout<<"Random Number Genorator"<<endl;
cout<<"======================="<<endl;
cout<<endl;
cout<<"|Custom - Press 1 | ";
cout<<"1 to 10 - Press 2 | ";
cout<<"1 to 50 - Press 3 | ";
cout<<"1 to 100 - Press 4|";
cin>>o;
cout<<endl;
cout<<"Amount of numbers (20 max):";
cin>>phi;
do
{
if(o == 1)
{
pi++;
cout<<endl;
cout<<"From 1 to : ";
cin>>ddd;
srand(time(0))
for(ii = 0; ii < 1; ii++)
{
if(phi == 1)
{
cout<<endl;
cout<<"Random Number: "<<rand()�d<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get()
cin.get()
}
if(phi == 2)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()�d<<", "<<rand()�d<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get()
cin.get()
}
if(phi == 3)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get()
cin.get()
}
if(phi == 4)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get()
cin.get()
}
if(phi == 5)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get()
cin.get()
}
if(phi == 6)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get()
cin.get()
}
if(phi == 7)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get()
cin.get()
}
if(phi == 8)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get()
cin.get()
}
if(phi == 9)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get()
cin.get()
}
if(phi == 10)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get()
cin.get()
}
if(phi == 11)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get()
cin.get()
}
if(phi == 12)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get()
cin.get()
}
if(phi == 13)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get()
cin.get()
}
if(phi == 14)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get()
cin.get()
}
if(phi == 15)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get()
cin.get()
}
if(phi == 16)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get()
cin.get()
}
if(phi == 17)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get()
cin.get()
}
if(phi == 18)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get()
cin.get()
}
if(phi == 19)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get()
cin.get()
}
if(phi == 20)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get()
cin.get()
}
}
}
}while(pi == phi)
if(o == 2)
{
do
{
if(o == 1)
{
pi++;
cout<<endl;
cout<<"From 1 to : ";
cin>>ddd;
srand(time(0))
for(ii = 0; ii < 1; ii++)
{
if(phi == 1)
{
cout<<endl;
cout<<"Random Number: "<<rand()�d<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get()
cin.get()
}
if(phi == 2)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()�d<<", "<<rand()�d<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get()
cin.get()
}
if(phi == 3)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get()
cin.get()
}
if(phi == 4)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get()
cin.get()
}
if(phi == 5)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get()
cin.get()
}
if(phi == 6)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get()
cin.get()
}
if(phi == 7)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get()
cin.get()
}
if(phi == 8)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get()
cin.get()
}
if(phi == 9)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get()
cin.get()
}
if(phi == 10)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get()
cin.get()
}
if(phi == 11)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get()
cin.get()
}
if(phi == 12)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get()
cin.get()
}
if(phi == 13)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get()
cin.get()
}
if(phi == 14)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get()
cin.get()
}
if(phi == 15)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get()
cin.get()
}
if(phi == 16)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get()
cin.get()
}
if(phi == 17)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get()
cin.get()
}
if(phi == 18)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get()
cin.get()
}
if(phi == 19)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get()
cin.get()
}
if(phi == 20)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<", "<<rand()�d<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get()
cin.get()
}
}
}
}while(pi == phi)
}
if(o == 3)
{
srand(time(0))
for(ii = 0; ii < 1; ii++)
{
cout<<endl;
cout<<"Random Number: "<<rand()P<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get()
cin.get()
}
}
if(o == 4)
{
pi++;
srand(time(0))
for(ii = 0; ii < 1; ii++)
{
if(phi == 1)
{
cout<<endl;
cout<<"Random Number: "<<rand()0<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get()
cin.get()
}
if(phi == 2)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()0<<", "<<rand()0<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get()
cin.get()
}
if(phi == 3)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()0<<", "<<rand()0<<", "<<rand()0<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get()
cin.get()
}
if(phi == 4)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get()
cin.get()
}
if(phi == 5)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get()
cin.get()
}
if(phi == 6)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get()
cin.get()
}
if(phi == 7)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get()
cin.get()
}
if(phi == 8)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get()
cin.get()
}
if(phi == 9)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get()
cin.get()
}
if(phi == 10)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get()
cin.get()
}
if(phi == 11)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get()
cin.get()
}
if(phi == 12)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get()
cin.get()
}
if(phi == 13)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get()
cin.get()
}
if(phi == 14)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get()
cin.get()
}
if(phi == 15)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get()
cin.get()
}
if(phi == 16)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get()
cin.get()
}
if(phi == 17)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get()
cin.get()
}
if(phi == 18)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get()
cin.get()
}
if(phi == 19)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get()
cin.get()
}
if(phi == 20)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<", "<<rand()0<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get()
cin.get()
}
}
}
cout<<endl;
cout<<"Menu - 1"<<endl;
cout<<"Exit - 2"<<endl;
cin>>xn;
}while(xn == 1)
}


(probablytoolongtopostorallowedtopost) ninja
Disconsented
Trying to decide of that programmer is:
1)A troll
2)Stupid
3)Bad Programmer
4)High
5)Drunk
6)All of the above.

Can somebody explain to me why people use single letters for variable names, I've always been under the impression that it is good practice the have the name relate to its purpose.
I like to use x for x-values, y for y-values, t for time values, i, j, .. in for loops, e for exceptions or events, ...

Of course it all depends on the situation, but a single letter can be a perfectly adequate (and not confusing) variable name.
not bad razz
Lanackse-Kanvae's avatar

Hallowed Lunatic

11,400 Points
  • Dressed Up 200
  • Forum Regular 100
  • Elocutionist 200
Reycom-Andrews
not bad razz


You're right it's not bad. IT'S ******** TERRIBLE.

If my Java tutor was to catch such s**t, you'd be docked a load of marks for that assignment and since 2 assignments each form 30% of the final grade for that module, you do not want to be dropping marks in assignments if you can help it.

That reminds me I must look into that thing about overriding instance variables from the defaults granted from another class.
Lanackse-Kanvae
Reycom-Andrews
not bad razz


You're right it's not bad. IT'S ******** TERRIBLE.

If my Java tutor was to catch such s**t, you'd be docked a load of marks for that assignment and since 2 assignments each form 30% of the final grade for that module, you do not want to be dropping marks in assignments if you can help it.

That reminds me I must look into that thing about overriding instance variables from the defaults granted from another class.


2 assignments to form 30% of the grade? That's a bit harsh. I'm in a 300 level Computer Science class that's using Java (and some Ada) as the course language, and even then, our grading structure is:

5 assignments worth 10% each
2 tests (one of which is a final) worth 25% each.
Let me point y'all at http://thedailywtf.com/ where this is fairly normal code. Such as this gem.. Be sure to scroll over and to also watch the video.
birdman3131


WHY WOULD YOU EVEN

That is so bad I'm not even going to use complete
birdman3131
Why is there even code after the first goto? It's not like it could be executed.
Lanackse-Kanvae's avatar

Hallowed Lunatic

11,400 Points
  • Dressed Up 200
  • Forum Regular 100
  • Elocutionist 200
kiraes
Lanackse-Kanvae
Reycom-Andrews
not bad razz


You're right it's not bad. IT'S ******** TERRIBLE.

If my Java tutor was to catch such s**t, you'd be docked a load of marks for that assignment and since 2 assignments each form 30% of the final grade for that module, you do not want to be dropping marks in assignments if you can help it.

That reminds me I must look into that thing about overriding instance variables from the defaults granted from another class.


2 assignments to form 30% of the grade? That's a bit harsh. I'm in a 300 level Computer Science class that's using Java (and some Ada) as the course language, and even then, our grading structure is:

5 assignments worth 10% each
2 tests (one of which is a final) worth 25% each.


It's harsh but that's reality for that particular module.
trezoid's avatar

Sparkly Lunatic

kiraes
Lanackse-Kanvae
Reycom-Andrews
not bad razz


You're right it's not bad. IT'S ******** TERRIBLE.

If my Java tutor was to catch such s**t, you'd be docked a load of marks for that assignment and since 2 assignments each form 30% of the final grade for that module, you do not want to be dropping marks in assignments if you can help it.

That reminds me I must look into that thing about overriding instance variables from the defaults granted from another class.


2 assignments to form 30% of the grade? That's a bit harsh. I'm in a 300 level Computer Science class that's using Java (and some Ada) as the course language, and even then, our grading structure is:

5 assignments worth 10% each
2 tests (one of which is a final) worth 25% each.


I had one unit where one assignment was worth 50%, one was worth 20%, and the exam is worth 30%...And that's pretty much normal.
Usaki Tsukino's avatar

Timid Bunny

trollcode lol

...my own code might not be so lousy after all xP
Scriptkittwenty's avatar

Feline Swapper

Sweet misery! Granted I've not programmed anything in two years and my knowledge of Java is limited... But this code makes me want to either slap someone or cry. Not entirely sure which I'd like to do more.

Quick Reply

Submit
Manage Your Items
Other Stuff
Get GCash
Offers
Get Items
More Items
Where Everyone Hangs Out
Other Community Areas
Virtual Spaces
Fun Stuff
Gaia's Games