mercredi 28 septembre 2016

Map rand5 to number in range

I Have a function call Rand5, that random number between 1..5, for example (1,1,1) (1,2,5) ...

I call random 5 three time so i have three numbers between 1-5.

generally there is 125 options.

I want to map the 125 options to numbers between 1 to 125.

so (1,1,1) map to 1. (1,1,5) map to 5. (1,2,2) map to 7. (5,5,5) map to 125.

Can you help me with pseudo-code.

Thank!




Aucun commentaire:

Enregistrer un commentaire