mardi 5 décembre 2017

Using for loops and random number?

I am extremely new to coding and my friend who tried to help me, "assigned" me a little coding project so that I can get more familiar with the popular for loops and the rand() function. She wants me to generate 100 random non-repeating numbers and put a break for every 10 numbers. The document would be html.

I kind of get how for loops work, as I coded a script that would list an array. However I have no idea how I would incorporate the rand() function? I don't even know what exactly that function does, and would appreciate some help.

This is not a homework question for any classes or project etc., just a couple of friends giving some inspiration to coding. If anyone writes some code for me, I would appreciate it if you could please explain from start to finish the logic behind how you thought to use certain codes. and what you wrote actually means, cause I do want to get a hang of it eventually, rather just relying on other people.

Thanks again, J




Aucun commentaire:

Enregistrer un commentaire