# Need help with random numbers

**URL:** <https://forum.kirupa.com/t/need-help-with-random-numbers/191612>\
**Category:** flash\
**Created:** [June 21, 2006, 7:53pm UTC](https://forum.kirupa.com/t/need-help-with-random-numbers/191612 "2006-06-21T19:53:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![woad](https://avatars.discourse-cdn.com/v4/letter/w/34f0e0/32.png) [@woad](https://forum.kirupa.com/u/woad)\
**Post date:** [June 21, 2006, 7:53pm UTC](https://forum.kirupa.com/t/need-help-with-random-numbers/191612/1 "2006-06-21T19:53:17Z")

</div>

Basically what I want is to have a random angle between 315 degrees and 45. How do i do that?  
And btw I don’t mean 45 between 315, it should exclude everything between those numbers.  
Example:

45 = max = 405 degrees  
315 = min = 315 degrees  
90 = **bad**  
180 = **bad**  
270 = **bad**

Nevermind I got it it’s in this format:  
angle = Math.random() \* (405 - 315) + 315;

When I posted this I forgot about the tutorial that told you how to do what i was asking.
