Posted By

badiali on 09/28/11


Tagged

javascript


Versions (?)

Numero aleatorio por rango


 / Published in: JavaScript
 

  1. function aleatorio(inferior,superior){
  2. numPosibilidades = superior - inferior
  3. aleat = Math.random() * numPosibilidades
  4. aleat = Math.round(aleat)
  5. return parseInt(inferior) + aleat
  6. }

Report this snippet  

You need to login to post a comment.