Absolutely Pointless And Completely Random!

Started by Takara, April 03, 2009, 07:09:20 PM

Previous topic - Next topic

0 Members and 3 Guests are viewing this topic.

Takara

Hey, look! I put the entire description of ME in only five words! That must be a new record! =D

Okay, so, I'm completely and utterly bored. Why don't we do a completely random interview-quiz thing like they do on super-cheezy TV shows to amuse ourselves? I'll be the host. (shuffles note cards) XD Now what contestants do I have the pleasure of introducing and interviewing?

Briar

#1
Haha, goodness you must be bored.

edit: sorry, didn't mean to make fun. :P

I'm Briar btw.  Nice to have ya here at RWL.
At the risk of ruining Briar's career by disparaging her find of the famous Sackaleaderer horse...

Quote from: Ungatt Trunn II
Yes. I wear high heels Krowdon. Any tips on how I should do my hair?

Gorak

I played ME once
it sucked
we destroyed the Borg

Carbz is awesome
Victory without honour, is more shameful then defeat.

Briar

At the risk of ruining Briar's career by disparaging her find of the famous Sackaleaderer horse...

Quote from: Ungatt Trunn II
Yes. I wear high heels Krowdon. Any tips on how I should do my hair?

Krowdon

Hai. My name is Krowdon and Tacos are yummy.
Quote from: Ashyra Nightwingi have work to do and that is why i'm playing rwl, this is how it always works

Martin the warrior

Who thinks that I am dead
Knows naught at all.
I-- am that is.
Two mice within Redwall.
The Warrior sleeps twixt Hall and Cavern Hole.
I-- am that is.
Take on my mighty role.

bjornredtail

0==={=B=J=O=R=N=R=E=D=T=A=I=L==>
AKA, Nevadacow
First person to ever play RWL

"Program testing can be used to show the presence of bugs, but never to show their absence!"-Edsger W. Dijkstra

Visit http://frostnflame.org today!

Shadow

#7
bjorn = (ME==mechanical engineering) ? foo : bar;
<=holbs-.. ..-holbs=> <=holbs-..

Krowdon

Quote from: Ashyra Nightwingi have work to do and that is why i'm playing rwl, this is how it always works

Gorak

Victory without honour, is more shameful then defeat.

Ungatt Trunn II

#10
DIE HIPPIE DIE

bjornredtail

Quote from: Shadow on April 07, 2009, 06:49:19 AM
bjorn = (ME==mechanical engineering) ? foo : bar;

Compiler Error: Statement With no effect.
* bjornredtail tries it...

NO way... There's just no way... that acctually compiles?
* bjornredtail tries with -wall flag
Oh, okay.
int main(int argc, char *argv[])
{
    int bjorn;
    int ME;
    int mechanical_engineering;
    int foo;
    int bar;

    bjorn = (ME==mechanical_engineering) ? foo: bar;

    return EXIT_SUCCESS;
}

Oh, right...
So, if ME == mechanical_engineering, then bjorn is set to a non-zero value (true) and foo is set to the same non-zero value. If ME != mechanical_engineering, then bjorn is set to 0 (false) and bar is set to 0.
0==={=B=J=O=R=N=R=E=D=T=A=I=L==>
AKA, Nevadacow
First person to ever play RWL

"Program testing can be used to show the presence of bugs, but never to show their absence!"-Edsger W. Dijkstra

Visit http://frostnflame.org today!

Shadow

#12
That exression is equivlent to:

if (ME == Mechanical_engineering)
        bjorn = foo;
else
        bjorn = bar;

but apparently it doesn't care if any of the variables are given values prior to the call? That's new to me, and I will definitely remember that on the off chance that I ever use that in real code.

Lol, I like C and all it's completely unnecessary equivelent control structures. I don''t like the random assigning of values that happens if you screw up, it makes debugging a pain in the butt.

WHats a -wall flag? :P
<=holbs-.. ..-holbs=> <=holbs-..

bjornredtail

Quote from: Shadow on April 08, 2009, 06:42:55 AM
That exression is equivlent to:

if (ME == Mechanical_engineering)
        bjorn = foo;
else
        bjorn = bar;

but apparently it doesn't care if any of the variables are given values prior to the call? That's new to me, and I will definitely remember that on the off chance that I ever use that in real code.

Lol, I like C and all it's completely unnecessary equivelent control structures. I don''t like the random assigning of values that happens if you screw up, it makes debugging a pain in the [Behind].

WHats a -wall flag? :P
You are right about the ternary ? (http://en.wikipedia.org/wiki/%3F: , I had to look it up).and you are more or less correct on the variables. C does not initialize variables. They are whatever random crap happened to be in the memory before things happened. So, the ME = Mechanical_engineering is almost random. Of course, it is most likely going to be 0, but that's besides the point. foo and bar are also crap. So, the value of bjorn is meaningless at the end of the program... That's why I didn't initialize my variables.

-Wall turns on all warnings in GCC.
0==={=B=J=O=R=N=R=E=D=T=A=I=L==>
AKA, Nevadacow
First person to ever play RWL

"Program testing can be used to show the presence of bugs, but never to show their absence!"-Edsger W. Dijkstra

Visit http://frostnflame.org today!

Shadow

<=holbs-.. ..-holbs=> <=holbs-..