Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

Randomising 2 numbers in a row is giving same random number?

$
0
0
hi all , for my little challenge i have been asked to get two random numbers for x and y so i have wrote in

int x = r.NextDouble();
int y = s.NextDouble();




(i have created new randoms ar beginning called r and s)

but when im debugging the code my numbers are coming out exactly the same? now i only just learnt about random numbers so this is only coding i have been taught and dont understand how i can make the numbers actually random ? creat each random number within there own class?

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>