Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-4041-

Horrors in ##C

Name: Anonymous 2010-07-28 15:34

Troll or complete moron?  You be the judge!

<sshorm> anyone around?
<sshorm> i'm looking for some help on a game i'm developing
<twkm> vague is as vague does.
<Love4Boobies> sshorm: What's the pay? ;)
<sshorm> pretty low to be honest
<sshorm> i'll show you my breasts tho
<sshorm> i'm writing a Battle Ship game to help me learn C
<sshorm> and it was going along really well
<sshorm> i spent a lot of time on it, and it's not very complex
<sshorm> but i'm running in to some logic problems
<sshorm> http://pastebin.com/V3jWjXtg
<twkm> does it help to know it doesn't compile?
<mauke> <conio.h>? you're fired
<Love4Boobies> If it's a learning project maybe you should do it try to do it alone.
<gh7d395pi69wd> 28,000 line testcase?
[11:57:51] <Love4Boobies> There are a bunch of switches each with one case... wtf.
<twkm> (c99 but implicit int for main)
<mauke> where's the c99?
<Love4Boobies> Looke into IF.
<twkm> mauke: line 18822.
<sshorm> what?
<Oddity> Do you have a question about C?
<sshorm> the switches were the only was i knew to do that logic
<sshorm> i thought it worked well and was simple
<sshorm> doesn't the compiler optimize all that anywayys?
<sshorm> so it shouldn't really matter
<mauke> twkm: heh
<mauke> sshorm: if you wrote all of that by hand, shoot yourself
<Jafet> I approve; more people should do this to pastebin.com.
<sshorm> mauke: i didn't type all of it out
<Oddity> phew
<sshorm> but i copy/pasted and edited the variables
<Oddity> ohno
<sshorm> didn't take too long
<twkm> *phear*
<Jafet> Hey, perhaps someday he'll learn to write a program to generate the code for him!
<sshorm> Jafet: yeah, that's what my professor said
<sshorm> but he told me he really liked the code
<Jafet> Great minds... oh, forget it
<sshorm> Jafet: how do i write a program to write my code for me?
<Jafet> I don't know. Write a program to tell you how.
<Oddity> sshorm: Do you have a C question?
<Oddity> Do you have any intelligent question at all?
<sshorm> Oddity: i asked a couple
<sshorm> what about my code?
<sshorm> Oddity: stop instulting me because i'm better than you at programming
<Oddity> Oh, about the compiler optimizing your 28,000 lines of switch statements.  Well, it might, but that doesn't mean this is good programming practice.  Do you think anyone would want to maintain this thing?
<sshorm> how many of you have written a 28000 line program?
<sshorm> i don't expect anyone to maintain it
<Oddity> That's good.
<sshorm> as long as i straighten out the logic issues, it should be perfect
<Oddity> You haven't told us what the logic issues are yet, or why ##C is the appropriate channel for those issues.
<sshorm> Oddity: maybe because it's in C?
<sshorm> if you have a problem with me, tell me
<Oddity> What are the logic issues?
<sshorm> don't insult me because i'm a better programmer than you
<Oddity> You won't have to worry about that.
<twkm> pigdude: sizing has little or nothing to do with c.
<sshorm> Oddity: good
<sshorm> Jafet: help?
<pigdude> twkm: got it, thanks
<sshorm> twkm: ?
<sshorm> it's sometimes saying that the wrong space was hit
<sshorm> in the game
<sshorm> i can't figure out why
<twkm> the logic is flawed.  consider using a debugger.
<bps> perhaps there is an error in one of your 23,000 lines of code
<Oddity> Probably because your program is 27000 lines longer than it should be.
<sshorm> my professor told me that length is a good part of the grade
<Jafet> sshorm: thankfully, you're beyond that stage.
<sshorm> he doesn't want us making it really short
<Oddity> Holy shit.
<bps> you are right. better pad your code out a few ten thousand lines more for maximum score
<sshorm> i don't see how you have room to criticize me when my college professor with a PHd says he likes my coding style
<Oddity> bps: Just like in the real world, right?
<drusepth> sshorm: you should really put { on new lines
<drusepth> it helps the compiler compile it faster or something
<psychoschlumpf> sshorm: so i'd say the PhD guy is an idiot
<sshorm> psychoschlumpf: shut up, you don't even have a degree
<bps> i have a phd in writing bad code and your code is great
<sshorm> bps: i'm sure you do
<sshorm> drusepth: what do you mean?
<sshorm> drusepth: oooo, good idea
<IceDane> sshorm: 1. Open your code in your favorite editor
<sshorm> that'll boost my lines of code
<IceDane> 2. ctrl + a
<IceDane> 3. backspace
<IceDane> 4. ctrl + s
<IceDane> 5. rewrite
<sshorm> Oddity: did you see what the logic error was?
<sshorm> IceDane: haha you almost got me
<sshorm> i stopped because ctrl + s is save

Name: Anonymous 2010-07-28 15:38

I read the prologue. Then I glanced at the code. Then I read the epilogue. I don't think I want to read the log proper.

Name: Anonymous 2010-07-28 15:39

Troll for sure ... but ... well ... I ...

Name: off topic 2010-07-28 15:43

I knew I'd seen the name mauke somewhere before

Name: Anonymous 2010-07-28 15:48

>>4
Yep, me too. #haskell? I think #haskell.

Name: Anonymous 2010-07-28 15:49

tl;dr

Name: Anonymous 2010-07-28 15:56

Complete moron, definitely

Name: Anonymous 2010-07-28 16:16

<sshorm> how many of you have written a 28000 line program?
He's right. I guess he is a better programmer than them.

Name: Anonymous 2010-07-28 16:53

Oh man that is the best code I've ever seen

Name: Anonymous 2010-07-28 16:55

Oh look, /prog/ was mentioned in #osdev

I'm so goddamn tired of your shit, `26. I should have known by the retarded crap you spew, that you were indeed drinking the /prog/ kool-aid

Name: Anonymous 2010-07-28 17:09

>>10
Oh look, #osdev was mentioned on /prog/

I'm so goddamn tired of your shit, /prog/. I should have known by the retarded crap you spew, that you were indeed drinking the #osdev kool-aid

Name: Anonymous 2010-07-28 20:37

class MyAnus extends UrAnus

Name: Anonymous 2010-07-28 21:16

Yes, I guess we'll never know

Now stop talking about it, or face the consequences

Name: Anonymous 2010-07-28 21:21

Name: Anonymous 2010-07-28 21:26

>>14
Cute

Name: Anonymous 2010-07-28 21:31

Assert(GetInstance("`26")->Status == MAD);

Name: Anonymous 2010-07-28 21:34

>>16
MAD (as in, ``U MAD'')
Back to the imageboards, please.

Name: Anonymous 2010-07-29 21:43

<Zhivago> Hmm. What's the appropriate place to ask a dhtml question, these days?

Name: Anonymous 2010-07-29 22:16

>>18
#html told him that the appropriate place was ##javascript !

Name: Anonymous 2010-07-29 22:27

Obvious troll is obvious. It looks pretty easy to generate. Plus, the comment at the top says it was written by "Simplicity".

Name: Anonymous 2010-07-30 1:05

>>20
I see code like this sometimes at work.

Name: Anonymous 2010-07-30 1:16

>>21
Is it one of: VB, PHP, JAVA -?

Name: Anonymous 2010-07-30 4:43

Thats some hardcore inlining.

Name: Anonymous 2010-07-30 5:48

Wow. 28000 lines. It does seem like a troll, but if it isn't, I can sympathize; for an absolute beginner, this is the logical way to do it before you learn about arrays.

As usual, ##c was amazingly unhelpful. I cannot fucking stand that channel because they never give a straight answer to anything. They could have just told him to use arrays, and that more lines of code are a bad thing. If he was real this would be legitimately helpful, and if he was a troll this would be the quickest way to spoil his fun. But no. They don't. They are all themselves just pedantic trolls. And so trolls troll trolls, and nothing changes in ##c. /rant

Name: Anonymous 2010-07-30 5:58

Wow. 28000 lines. It does seem like a troll, but if it isn't, I can sympathize; for an absolute beginner, this is the logical way to do it before you learn about arrays.
It's like saying that riding a bike in a car race is okay for a beginner that can't drive a car.

Name: Anonymous 2010-07-30 6:03

>>25
Well no, because you can actually see others driving cars, which would lead you to try it yourself. You can't see the game logic underlying a modern game, so the fact that they use data structures is not apparent.

Name: Anonymous 2010-07-30 6:52

>>26
Haha! You can't? It was easy to visualise even as an 11 year old

Name: Anonymous 2010-07-30 6:57

>>27
Lies 11 year olds do not have the logical facilities to even implement an ANSI C compiler.

Name: Anonymous 2010-07-30 7:09

>>28
Maybe not, but by that logic I could've easily written a Chipmunk BASIC compiler in Chipmunk BASIC when I was 11.

Name: Anonymous 2010-07-30 7:48

>>26
HAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHA

Name: Anonymous 2010-07-30 11:01

OpenConsole(); Fastest Nbody benchmark in PureBasic (2.5s per 5m)
Start = ElapsedMilliseconds() ;  
PI4.d=ValD("39.47841760435742848212")
YEAR.d=365.24
DT.d=0.01

x0.d=0;
y0.d=0;
z0.d=0;
vx0.d=-0.0003876634071987;
vy0.d=-0.0032753590371766;
vz0.d=0.0000239357340800;
mass0.d=PI4;

x1.d=4.84143144246472090e+00;
y1.d=-1.16032004402742839e+00;
z1.d=-1.03622044471123109e-01;
vx1.d=1.66007664274403694e-03*YEAR;
vy1.d=7.69901118419740425e-03*YEAR;
vz1.d=-6.90460016972063023e-05*YEAR;
mass1.d=9.54791938424326609e-04*PI4;


x2.d=8.34336671824457987e+00;
y2.d=4.12479856412430479e+00;
z2.d=-4.03523417114321381e-01;
vx2.d=-2.76742510726862411e-03*YEAR;
vy2.d=4.99852801234917238e-03*YEAR;
vz2.d=2.30417297573763929e-05*YEAR;
mass2.d=2.85885980666130812e-04*PI4;


x3.d=1.28943695621391310e+01;
y3.d=-1.51111514016986312e+01;
z3.d=-2.23307578892655734e-01;
vx3.d=2.96460137564761618e-03*YEAR;
vy3.d=2.37847173959480950e-03*YEAR;
vz3.d=-2.96589568540237556e-05* YEAR;
mass3.d=4.36624404335156298e-05*PI4;


x4.d=1.53796971148509165e+01;
y4.d=-2.59193146099879641e+01;
z4.d=1.79258772950371181e-01;
vx4.d=2.68067772490389322e-03*YEAR;
vy4.d=1.62824170038242295e-03*YEAR;
vz4.d=-9.51592254519715870e-05*YEAR;
mass4.d=5.15138902046611451e-05*PI4;

n=Val(ProgramParameter());
If n<1
  n=5000000
EndIf
dist.d;
e.d;
dx.d;
dy.d;
dz.d;
mag.d;
e=0.0;
e=e+0.5*mass0*(vx0*vx0+vy0*vy0+vz0*vz0);
e=e+0.5*mass1*(vx1*vx1+vy1*vy1+vz1*vz1);
e=e+0.5*mass2*(vx2*vx2+vy2*vy2+vz2*vz2);
e=e+0.5*mass3*(vx3*vx3+vy3*vy3+vz3*vz3);
e=e+0.5*mass4*(vx4*vx4+vy4*vy4+vz4*vz4);
dist=((x0-x1)*(x0-x1))+((y0-y1)*(y0-y1))+((z0-z1)*(z0-z1));
e=e-((mass0*mass1)/Sqr(dist));
dist=((x0-x2)*(x0-x2))+((y0-y2)*(y0-y2))+((z0-z2)*(z0-z2));
e=e-((mass0*mass2)/Sqr(dist));
dist=((x0-x3)*(x0-x3))+((y0-y3)*(y0-y3))+((z0-z3)*(z0-z3));
e=e-((mass0*mass3)/Sqr(dist));
dist=((x0-x4)*(x0-x4))+((y0-y4)*(y0-y4))+((z0-z4)*(z0-z4));
e=e-((mass0*mass4)/Sqr(dist));

dist=((x1-x2)*(x1-x2))+((y1-y2)*(y1-y2))+((z1-z2)*(z1-z2));
e=e-((mass1*mass2)/Sqr(dist));
dist=((x1-x3)*(x1-x3))+((y1-y3)*(y1-y3))+((z1-z3)*(z1-z3));
e=e-((mass1*mass3)/Sqr(dist));
dist=((x1-x4)*(x1-x4))+((y1-y4)*(y1-y4))+((z1-z4)*(z1-z4));
e=e-((mass1*mass4)/Sqr(dist));

dist=((x2-x3)*(x2-x3))+((y2-y3)*(y2-y3))+((z2-z3)*(z2-z3));
e=e-((mass2*mass3)/Sqr(dist));
dist=((x2-x4)*(x2-x4))+((y2-y4)*(y2-y4))+((z2-z4)*(z2-z4));
e=e-((mass2*mass4)/Sqr(dist));

dist=((x3-x4)*(x3-x4))+((y3-y4)*(y3-y4))+((z3-z4)*(z3-z4));
e=e-((mass3*mass4)/Sqr(dist));



PrintN (StrD(e,9)+"<-Offset momentum: "+StrU(n)+" Iterations");

While n<>0
dx =(x0-x1);
dy = (y0-y1);
dz = (z0-z1);
mag=(dx*dx)+(dy*dy)+(dz*dz)
mag= DT /(Sqr(mag)*mag);
vx0=vx0-(dx*mass1*mag);
vy0=vy0-(dy*mass1*mag);
vz0=vz0-(dz*mass1*mag);
vx1=vx1+(dx*mass0*mag);
vy1=vy1+(dy*mass0*mag);
vz1=vz1+(dz*mass0*mag);
dx =(x0-x2);
dy = (y0-y2);
dz = (z0-z2);
mag=(dx*dx)+(dy*dy)+(dz*dz)
mag= DT /(Sqr(mag)*mag);
vx0=vx0-(dx*mass2*mag);
vy0=vy0-(dy*mass2*mag);
vz0=vz0-(dz*mass2*mag);
vx2=vx2+(dx*mass0*mag);
vy2=vy2+(dy*mass0*mag);
vz2=vz2+(dz*mass0*mag);
  dx =(x0-x3);
dy = (y0-y3);
dz = (z0-z3);
mag=(dx*dx)+(dy*dy)+(dz*dz)
mag= DT /(Sqr(mag)*mag);
vx0=vx0-(dx*mass3*mag);
vy0=vy0-(dy*mass3*mag);
vz0=vz0-(dz*mass3*mag);
vx3=vx3+(dx*mass0*mag);
vy3=vy3+(dy*mass0*mag);
vz3=vz3+(dz*mass0*mag);

dx =(x0-x4);
dy = (y0-y4);
dz = (z0-z4);
mag=(dx*dx)+(dy*dy)+(dz*dz)
mag= DT /(Sqr(mag)*mag);
vx0=vx0-(dx*mass4*mag);
vy0=vy0-(dy*mass4*mag);
vz0=vz0-(dz*mass4*mag);
vx4=vx4+(dx*mass0*mag);
vy4=vy4+(dy*mass0*mag);
vz4=vz4+(dz*mass0*mag);

dx =(x1-x2);
dy = (y1-y2);
dz = (z1-z2);
mag=(dx*dx)+(dy*dy)+(dz*dz)
mag= DT /(Sqr(mag)*mag);
vx1=vx1-(dx*mass2*mag);
vy1=vy1-(dy*mass2*mag);
vz1=vz1-(dz*mass2*mag);
vx2=vx2+(dx*mass1*mag);
vy2=vy2+(dy*mass1*mag);
vz2=vz2+(dz*mass1*mag);

dx =(x1-x3);
dy = (y1-y3);
dz = (z1-z3);
mag=(dx*dx)+(dy*dy)+(dz*dz)
mag= DT /(Sqr(mag)*mag);
vx1=vx1-(dx*mass3*mag);
vy1=vy1-(dy*mass3*mag);
vz1=vz1-(dz*mass3*mag);
vx3=vx3+(dx*mass1*mag);
vy3=vy3+(dy*mass1*mag);
vz3=vz3+(dz*mass1*mag);

dx =(x1-x4);
dy = (y1-y4);
dz = (z1-z4);
mag=(dx*dx)+(dy*dy)+(dz*dz)
mag= DT /(Sqr(mag)*mag);
vx1=vx1-(dx*mass4*mag);
vy1=vy1-(dy*mass4*mag);
vz1=vz1-(dz*mass4*mag);
vx4=vx4+(dx*mass1*mag);
vy4=vy4+(dy*mass1*mag);
vz4=vz4+(dz*mass1*mag);
dx =(x2-x3);
dy = (y2-y3);
dz = (z2-z3);
mag=(dx*dx)+(dy*dy)+(dz*dz)
mag= DT /(Sqr(mag)*mag);
vx2=vx2-(dx*mass3*mag);
vy2=vy2-(dy*mass3*mag);
vz2=vz2-(dz*mass3*mag);
vx3=vx3+(dx*mass2*mag);
vy3=vy3+(dy*mass2*mag);
vz3=vz3+(dz*mass2*mag);
dx =(x2-x4);
dy = (y2-y4);
dz = (z2-z4);
mag=(dx*dx)+(dy*dy)+(dz*dz)
mag= DT /(Sqr(mag)*mag);
vx2=vx2-(dx*mass4*mag);
vy2=vy2-(dy*mass4*mag);
vz2=vz2-(dz*mass4*mag);
vx4=vx4+(dx*mass2*mag);
vy4=vy4+(dy*mass2*mag);
vz4=vz4+(dz*mass2*mag);
dx =(x3-x4);
dy = (y3-y4);
dz = (z3-z4);
mag=(dx*dx)+(dy*dy)+(dz*dz)
mag= DT /(Sqr(mag)*mag);
vx3=vx3-(dx*mass4*mag);
vy3=vy3-(dy*mass4*mag);
vz3=vz3-(dz*mass4*mag);
vx4=vx4+(dx*mass3*mag);
vy4=vy4+(dy*mass3*mag);
vz4=vz4+(dz*mass3*mag);
x0=x0+(DT*vx0);
y0=y0+(DT*vy0);
z0=z0+(DT*vz0);
x1=x1+(DT*vx1);
y1=y1+(DT*vy1);
z1=z1+(DT*vz1);
x2=x2+(DT*vx2);
y2=y2+(DT*vy2);
z2=z2+(DT*vz2);
x3=x3+(DT*vx3);
y3=y3+(DT*vy3);
z3=z3+(DT*vz3);
x4=x4+(DT*vx4);
y4=y4+(DT*vy4);
z4=z4+(DT*vz4);
  n=n-1;
Wend

e=0.0;
e=e+0.5*mass0*(vx0*vx0+vy0*vy0+vz0*vz0);
e=e+0.5*mass1*(vx1*vx1+vy1*vy1+vz1*vz1);
e=e+0.5*mass2*(vx2*vx2+vy2*vy2+vz2*vz2);
e=e+0.5*mass3*(vx3*vx3+vy3*vy3+vz3*vz3);
e=e+0.5*mass4*(vx4*vx4+vy4*vy4+vz4*vz4);
dist=((x0-x1)*(x0-x1))+((y0-y1)*(y0-y1))+((z0-z1)*(z0-z1));
e=e-((mass0*mass1)/Sqr(dist));
dist=((x0-x2)*(x0-x2))+((y0-y2)*(y0-y2))+((z0-z2)*(z0-z2));
e=e-((mass0*mass2)/Sqr(dist));
dist=((x0-x3)*(x0-x3))+((y0-y3)*(y0-y3))+((z0-z3)*(z0-z3));
e=e-((mass0*mass3)/Sqr(dist));
dist=((x0-x4)*(x0-x4))+((y0-y4)*(y0-y4))+((z0-z4)*(z0-z4));
e=e-((mass0*mass4)/Sqr(dist));

dist=((x1-x2)*(x1-x2))+((y1-y2)*(y1-y2))+((z1-z2)*(z1-z2));
e=e-((mass1*mass2)/Sqr(dist));
dist=((x1-x3)*(x1-x3))+((y1-y3)*(y1-y3))+((z1-z3)*(z1-z3));
e=e-((mass1*mass3)/Sqr(dist));
dist=((x1-x4)*(x1-x4))+((y1-y4)*(y1-y4))+((z1-z4)*(z1-z4));
e=e-((mass1*mass4)/Sqr(dist));

dist=((x2-x3)*(x2-x3))+((y2-y3)*(y2-y3))+((z2-z3)*(z2-z3));
e=e-((mass2*mass3)/Sqr(dist));
dist=((x2-x4)*(x2-x4))+((y2-y4)*(y2-y4))+((z2-z4)*(z2-z4));
e=e-((mass2*mass4)/Sqr(dist));

dist=((x3-x4)*(x3-x4))+((y3-y4)*(y3-y4))+((z3-z4)*(z3-z4));
e=e-((mass3*mass4)/Sqr(dist));



PrintN (StrD(e,9)+"<-Offset momentum: "+StrU(n)+" Iteration");

Endt= ElapsedMilliseconds()  ;
PrintN("Elapsed :"+Str(Endt-Start)+" milliseconds");

Name: Anonymous 2010-07-30 11:59

i don't see how you have room to criticize me when my college professor with a PHd says he likes my coding style

Name: Anonymous 2010-07-30 12:11

I know who this is, and he was trolling. The code was written by an idiot from a "wannabe hacker forum", valiantly posting it to serve as an example for simple game programming in C++.

Apparently, if you get good, you can whip up stuff like that in a  few hours.

Name: Anonymous 2010-07-30 15:06

>>33
U mena less than an hour in C99. Or even less than that in Lisp.

Name: Anonymous 2010-07-30 15:15

>>34
I think you need to have things explained in pictures. We can't do that here, sorry. Get out.

Name: Anonymous 2010-07-30 15:23

>>35
Your am idiot and can't tell the differences in who belongs where (and you don't sage properly) so I think that it is you who should take the advice of yourself.

Name: Anonymous 2010-07-30 16:49

>>18
<Zhivago>?!

Name: Anonymous 2010-07-30 17:04

>>37
yes. he is xarn

Name: Anonymous 2010-07-30 17:30

>>36
*Your and idiot

Name: Anonymous 2010-07-30 21:31

>>32
PHd
Get the fuck out!

Name: Anonymous 2010-12-17 1:29

Xarn is a bad boyfriend

Name: Anonymous 2011-10-23 16:55

Zhivago is the most informative person ever. There is nothing Zhivago cannot explain.
            o                                            
                 O       /`-.__                          
                        /  \.'^|                         
           o           T    l  *                         
                      _|-..-|_                           
               O    (^ '----' `)     I HELP THE MENTALLY RETARDED PEOPLE
                     `\-....-/^      BECOME LESS STUPID WITH ZHIVAGO!
           O       o  ) "/ " (      /                    
                     _( (-)  )_                          
                 O  /\ )    (  /\                        
                   /  \(    ) |  \                       
               o  o    \)  ( /    \                      
                 /     |(  )|      \                     
                /    o \ \( /       \                    
          __.--'   O    \_ /   .._   \                   
         //|)\      ,   (_)   /(((\^)'\                  
            |       | O         )  `  |                  
            |      / o___      /      /                  
           /  _.-''^^__O_^^''-._     /                   
         .'  /  -''^^    ^^''-  \--'^                    
       .'   .`.  `'''----'''^  .`. \                     
     .'    /   `'--..____..--'^   \ \                    
    /  _.-/                        \ \                   
.::'_/^   |                        |  `.                 
       .-'|                        |    `-.              
 _.--'`   \                        /       `-.           
/          \                      /           `-._       
`'---..__   `.                  .`_.._   __       \      
         ``'''`.              .'##C   `'^  `''---'^      
                `-..______..-'

Name: Anonymous 2011-10-23 16:59

>>32
Very simple really: those that can't do, teach.
If he were a good coder he'd be properly employed instead of working part time, trying to beat sense into know-it-all post-pubescent young adults.

Name: Anonymous 2011-10-23 17:39

This is my favorite troll.

Name: Anonymous 2013-07-27 15:42

I'm black and I think this is funny as hell

Don't change these.
Name: Email:
Entire Thread Thread List