this is what I've done so far ... can you tell me where I've gone wrong ,this code is supposed to give me non repeating random numbers from 1~6 , but when I try to run it gives me results like 1-5-5-4-3-2 , 2-3-4-4-5-6...it looks like I got the first two numbers correct because they are always different each time I run it but I'm not very sure tho.
It's because you don't have any conditions checking if the random number already produced is already provided once. What you should do is create another array or preferably an arraylist, then when you encounter a random number, check if it exists on the list of the numbers already existing, if not, add it to the list, if it exists, loop again. I believe you should use a do while loop with this one.
You have a problem with a loop, if the next time the number generated is the same you dont check for it again, instead you go forward. In your inner for loop, if the number generated matches, just restart the loop to start again. Something like: