# Math.random() troubles

**URL:** <https://forum.kirupa.com/t/math-random-troubles/222709>\
**Category:** Uncategorized\
**Created:** [April 16, 2007, 1:03pm UTC](https://forum.kirupa.com/t/math-random-troubles/222709 "2007-04-16T13:03:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![SpyrL](https://avatars.discourse-cdn.com/v4/letter/s/90db22/32.png) [@SpyrL](https://forum.kirupa.com/u/SpyrL)\
**Post date:** [April 16, 2007, 1:03pm UTC](https://forum.kirupa.com/t/math-random-troubles/222709/1 "2007-04-16T13:03:39Z")

</div>

I have been making a shooting game(birds-eye view), and have put ‘Bots’ into it but i seem to be have trouble making the bots spawn randomly over the entire map. (550w x 400h-the usual)  
I have tried using the Math.random function but it only picks between 0 and 1; is there a way to make Math.random choose between 0 - 550 (for the width of screen) ???  
Or would i have to make some function for that purpose?
