hay guise!
I'm using java and have this method in a class that does:
public static int[] randomArray(int n) {
int a=10;
int i=0;
int[] temp=new int[n];
while(i<temp.length) {//a while loop to determine the values in each
//position of the array
double r=Math.random();//a random number in [0,1)
temp[i]=randomInt(10);//if a is in [0,1), then ra is in [0,ra).
//So, take the floor of ra and then add 1.
System.out.println(temp[i]);
i++;
}
return temp;
}
and I call the ArrayHelp.randomArray(100); so how do I copy the contents from the method and save it in a array?
- Learn to write meaningful comments
- Learn to not write useless comments
- Learn to not double r=Math.random(); in your loop for no apparent reason
- Learn to not print out shit in your loop
- Learn to not declare useless variables
- Read SICP
Name:
Anonymous2007-10-08 13:02
public static void randomArray(int[] a) {
for (int i = 0; i < a.length; a[i] = (int) (Math.random() * 10), i++);
}
>>2 HAHAHAHA
YOU THINK YOURE THOUGH UH ?
I HAVE ONE WORD FOR YOU
THE FORCED INDENTATION OF THE CODE
GET IT ?
I DONT THINK SO
YOU DONT KNOW ABOUT MY OTHER CAR I GUESS ?
ITS A CDR
AND IS PRONOUNCED ``CUDDER'' OK YOU FUQIN ANGERED AN EXPERT PROGRAMMER
THIS IS /prog/
YOU ARE ALLOWED TO POST HERE ONLY IF YOU HAVE ACHIEVED SATORI
PROGRAMMING IS ALL ABOUT ``ABSTRACT BULLSHITE'' THAT YOU WILL NEVER COMPREHEND
I HAVE READ SICP
IF ITS NOT DONE YOU HAVE TO
TOO BAD RUBY ON RAILS IS SLOW AS FUCK BBCODE AND((SCHEME))ARE THE ULTIMATE LANGUAGES
ALSO
WELCOME TO /prog/
EVERY THREAD WILL BE REPLIED TO
NO EXCEPTION
>>7
I created this copypasta, mate, and this ain't no meme stealing talk, I'm dead serious, so don't go talking about understanding the ``welcome to /prog/'' copypasta to me, mkay?
Name:
Anonymous2007-10-08 14:20
>>8
No, I did create the original text from this copypasta. True story.
Name:
Anonymous2007-10-08 14:23
>>8
you should realise then, you just mushed together a bunch of shit scraped from the bowels of /prog/, that which was digested from when /prog/ was good.
Name:
Anonymous2007-10-08 14:40
>>10
FUCK FUCK FUCK FUCK YOU I MADE /prog/ GREAT I AM THE INVENTOR OF ALL MEMES I INVENTED EVERY MEME FROM THE FORCED INDENTATION TO BBCODE. I GUESS YOU ARE TALKING ABOUT THE ``SHITTY OLD TIME" I REMEMBER THE FIRST THREAD I SAW WHEN I FIRST CAME TO /prog/ WAS CALLED ``TO JAPANESE PROGRAMMERS" AND IT SAID ``USE UNICODE GODDAMMIT" THERE WERE NO OLD-MODERN IDEAS LIKE REUSING SCHEME. /prog/RAMMERS WERE A BUNCH OF JAVA-OR-PYTHON FANBOYS ARGUING ON WHICH LANGUAGE IS THE BEST. WHEN I SAW THAT I HAD A PLAN SO I INVENTED THE FORCED INDENTATION MEME THAT'S WHERE IT ALL STARTED BEFORE THAT IT COULD BE CALLED THE ``PALEOLITHIC OF /prog/" THEN I POSTED THE ``I AM AN EXPERT PROGRAMMER THREAD" I KNEW PEOPLE WOULD REMEMBER THIS THREAD FOREVER BECAUSE I HAVE WRITEN HUGE PROGRAMS THAT YOU COULDNT EVEN COMPREHEND THEN I KNEW IT WAS TIME TO TALK ABOUT MORE ``ABSTRACT" CONCEPTS, I KNEW IT WAS TIME TO INTRODUCE SCHEME AND SATORI ENTERED IN /prog/ FOR THE FIRST TIME BUT BECAUSE SOMETHING WAS LACKING IN /prog/ AND SATORI COULDNT BE CONSIDERED AS A MEME BUT MORE AS A PHILOSOPHY I INVENTED THE BBCODE MEME. THAT'S HOW /prog/ STARTED ANY OTHER STORY YOU MIGHT'VE HEARD ARE MADE OF LIES
>>11
FUCK FUCK FUCK FUCK YOU I MADE /prog/ GREAT I AM THE INVENTOR OF ALL MEMES I INVENTED EVERY MEME FROM THE FORCED INDENTATION TO BBCODE. I GUESS YOU ARE TALKING ABOUT THE ``SHITTY OLD TIME" I REMEMBER THE FIRST THREAD I SAW WHEN I FIRST CAME TO /prog/ WAS CALLED ``TO JAPANESE PROGRAMMERS" AND IT SAID ``USE UNICODE GODDAMMIT" THERE WERE NO OLD-MODERN IDEAS LIKE REUSING SCHEME. /prog/RAMMERS WERE A BUNCH OF JAVA-OR-PYTHON FANBOYS ARGUING ON WHICH LANGUAGE IS THE BEST. WHEN I SAW THAT I HAD A PLAN SO I INVENTED THE FORCED INDENTATION MEME THAT'S WHERE IT ALL STARTED BEFORE THAT IT COULD BE CALLED THE ``PALEOLITHIC OF /prog/" THEN I POSTED THE ``I AM AN EXPERT PROGRAMMER THREAD" I KNEW PEOPLE WOULD REMEMBER THIS THREAD FOREVER BECAUSE I HAVE WRITEN HUGE PROGRAMS THAT YOU COULDNT EVEN COMPREHEND THEN I KNEW IT WAS TIME TO TALK ABOUT MORE ``ABSTRACT" CONCEPTS, I KNEW IT WAS TIME TO INTRODUCE SCHEME AND SATORI ENTERED IN /prog/ FOR THE FIRST TIME BUT BECAUSE SOMETHING WAS LACKING IN /prog/ AND SATORI COULDNT BE CONSIDERED AS A MEME BUT MORE AS A PHILOSOPHY I INVENTED THE BBCODE MEME. THAT'S HOW /prog/ STARTED ANY OTHER STORY YOU MIGHT'VE HEARD ARE MADE OF LIES
The connect variable before the thread got a chance to practice keyboard typing General public are strictly prohibited to access this thread is not about what this thread is bad and written by people that sum more money than we can even imagine how large the recovery operation would be to remove?
Name:
Anonymous2009-07-12 6:17
>>12
up you're Your again. wife John, called, car don't on don't don't the make don't ..-%m-%-* ..-%m-%-* to this your this me me prog prog prog killall [1]+ $ One the in of of song You of go That's the tag, your /prog/. time! /prog/. it