Answer the question
In order to leave comments, you need to log in
How to correctly distribute (what?)?
Hello!
There are two ranges of numbers. From 1 to 10 thousand, from 1 to 10.
It is necessary to assign a number from the second range to each number from the first range so that the numbers from the second range are divided evenly, but in a different order. The number 714 of the first range can mean 8, and 715 - 3, but in general, such distributions should be more or less the same.
Ultimately, you are interested in a function that receives a number from 1 to 10 thousand by returning a number from 1 to 10.
Random is excluded.
Thank you!
Answer the question
In order to leave comments, you need to log in
For inspiration:
$n % 10
will always return from 0 to 9. Add 1$z = 1;
for ($i = 1; $i <= 10000; $i++) {
echo $i . $z;
if ($z == 10)
$z = 1;
else
++$z;
}
function makeMeSmall($int){
return ceil($int/1000);
}
function makeMeSmallAgain($int){
return substr($int,-1)?substr($int,-1):1;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question