Jump to content

Ok, What Did I Do Wrong Now?


Recommended Posts

Tried to make a "Guess the Numbar!11!1!11!1OONEOENEONE" game...

 

#include <iostream>
#include <stdlib.h>
#include <time.h>

using namespace std;

srand(time(NULL));

long theNumber = rand()%999999999999;
long guess;

int main()

{
    cout << "Guess the number!\nYour guess> ";
    cin >> guess;
    
    if(guess!=theNumber) {
        cout << "YOU ARE GAY! GET THE $#@! OUT!\n\n\n";
        system("pause");
        
    }
    
    else {
        cout << "YOU ARE HACKING! GET THE $*&! OUT!\n\n\n";
        system("pause");
        
        }
        
    return 0;
    
        }

 

What did I do wrong this time?

 

 

 

 

 

PS It's motivational, I swear!

Edited by Kamikaze_Badger

Share this post


Link to post
Share on other sites

#include <iostream>

#include <stdlib.h>

#include <time.h>

 

using namespace std;

 

srand(time(NULL)); <---- this shouldn't be here

 

long theNumber = rand()%999999999999;

long guess;

 

 

That's all I can see..... at the moment......

 

EDIT: that srand() thing should be in main() with everything else

 

And I found a me with short hair :lol: be very afraid..

 

post-77819-0-22178200-1308248832_thumb.jpg vs post-32354-0-67547300-1308252435_thumb.png

Share this post


Link to post
Share on other sites

How does the rand function get seeded then?

 

 

 

Btw, the one of the left is a bit sexier than the one on the right... did you have poor C coding skills back then?

 

EDIT: OOOOOOH, dang.... I be stupid.

Edited by Kamikaze_Badger

Share this post


Link to post
Share on other sites

omg it looks like jesus :lol: j/k

520023[/snapback]

 

lol that's not the first time I have heard that one :rolleyes: everyone says that :D

 

How does the rand function get seeded then?

Btw, the one of the left is a bit sexier than the one on the right... did you have poor C coding skills back then?

520024[/snapback]

 

You can use srand() just... no actual code should be outside of a function. I made an edit to that post saying to put it in with main() (at the top)

 

:lol: yes, yes I did. Very poor indeed.

Share this post


Link to post
Share on other sites

#include <iostream>

#include <stdlib.h>

#include <time.h>

 

using namespace std;

 

srand(time(NULL)); <---- this shouldn't be here

 

long theNumber = rand()%999999999999;

long guess;

That's all I can see..... at the moment......

 

EDIT: that srand() thing should be in main() with everything else

 

And I found a me with short hair :lol: be very afraid..

 

post-77819-0-22178200-1308248832_thumb.jpg vs post-32354-0-67547300-1308252435_thumb.png

520021[/snapback]

LOL markie you look exactly like this guy who has been stealing from my work.

Share this post


Link to post
Share on other sites

So, if I cut off your hair...

 

<later on at night>

 

"Oh Markie! The BASIC coders are coming again!"

 

<Markie runs to open up Dev-C++>

 

"Omg... I forgot which includes to use... NOOOOO! WHERE'S MY HAIR!?"

520028[/snapback]

 

:lol:

 

an example of what I was writing back at the time that picture was taken (around 2 years ago.. college time?)

 

This was actually... one of my assignments :)

 

 

post-32575-0-05141200-1308461491_thumb.jpg

 

 

lmao, you look a good 10 years older with long hair  :huh:

520029[/snapback]

 

I've been told I look a few years older when wearing my glasses :lol: yikes!!!

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...