|
Super Lloyd wrote: A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station....
I want to steal your signature!
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
Ho no... I already stole it from someone else, you can't steal it from me!!!
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station....
_________________________________________________________
My programs never have bugs, they just develop random features.
|
|
|
|
|
if(guess == random)
{
printf("\nExcellent! You guessed the number!\nWould you like to play again?(y/n)");
scanf("%c",&play);
if(play == 'n')
{
game = 0;
}
}
else
{
if(guess < random && guess != random)
{
printf("\nToo low, try again!");
}
if(guess > random && guess != random)
{
printf("\nToo high, try again!");
}
}
Reference[^]
Parag Patel
Sr. Software Eng, Varaha Systems
|
|
|
|
|
if(guess < random && guess != random)
{
printf("\nToo low, try again!");
}
if(guess > random && guess != random)
{
printf("\nToo high, try again!");
}
nice...
my guess would be: never trust a computer...
(yes|no|maybe)*
|
|
|
|
|
It's just to easy to imagine this person is now bragging about his program and trying to impress others with his coding skills - lol.
|
|
|
|
|
was he irish by any chance... you got to be sure after all?
|
|
|
|
|
if(guess == random)
{
[...]
}
else
{
if(guess < random &&
guess != random)
{
[...]
}
else
{
if(guess > random &&
guess != random &&
!(guess < random &&
guess != random))
{
[...]
}
}
}
Fixed it!!
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
|
Interesting article, but it only has backward links. Is there a list that links to all 11 parts available somewhere?
It is a truth universally acknowledged that a zombie in possession of brains must be in want of more brains.
-- Pride and Prejudice and Zombies
|
|
|
|
|
This one is better to be sure
if(guess == random && !(guess != random))
|
|
|
|
|
|
This is my five cents
if(guess == random || guess != random)
|
|
|
|
|
|
Found in an article approved not too long ago...
And no, I didn't throw out case 5.
public int Volume
{
get { return this.volume; }
set
{
if (value < 0) { this.volume = 0; }
else if (value > 10) { this.volume = 10; }
else { this.volume = value; }
switch ( this.volume )
{
case 0: this.volume = 10; break;
case 1: this.volume = 9; break;
case 2: this.volume = 8; break;
case 3: this.volume = 7; break;
case 4: this.volume = 6; break;
case 6: this.volume = 4; break;
case 7: this.volume = 3; break;
case 8: this.volume = 2; break;
case 9: this.volume = 1; break;
case 10: this.volume = 0; break;
}
this.volume = this.volume * -100;
this.player.Volume = this.volume;
}
}
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
mav.northwind wrote: no, I didn't throw out case 5.
Why would you? Anyone can see it isn't necessary and the original author has optimised it out for efficiency reasons.
|
|
|
|
|
How about:
this.volume = 10 - this.volume; Or is that too verbose?
mav.northwind wrote: this.volume = this.volume * -100;
So, first prevent setting the volume to any value lower than 0 and than set it way below 0 every time?
mav.northwind wrote: this.player.Volume = this.volume;
Good job causing an endless recursion...
|
|
|
|
|
I just love the effect of
this.volume++;
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
an old textbook way to improve your efficiency when your boss is using TLOC
using float will make him much more efficient.
|
|
|
|
|
From one of the articles on this very website a description of a function named Open:
Opens an existing WAV file. Returns a String, which will be blank upon success, and upon error, will contain the reason it failed. This method will throw an exception for a more serious error.
|
|
|
|
|
|
|
|
I think SQL Server calls that "Success with information".
|
|
|
|
|
All errors are equal, but some errors are more equal than others...
(yes|no|maybe)*
|
|
|
|
|
s_mon wrote: All errors are equal, but some errors are more equal than others...
Seems I've heard that before. Maybe at that farm I used to work at?
|
|
|
|