title: Swift random number problems
body: <p>I am using Swift with Xcode 6 Beta 5, and trying to generate a random number between my specific constraints.</p>
  
  <p>Currently I am using the arc4random_uniform() function, which works for simple generating like:</p>
  
  <pre><code>arc4random_uniform(5)
  </code></pre>
  
  <p>But I am trying to create a random number with some complicated boundaries. This is my attempt:</p>
  
  <pre><code>randomMovement = Int( arc4random_uniform( (0.25 * Int(cs)) - ( 0.175 * rd ) ) ) + Int( 0.175 * rd )
  </code></pre>
  
  <p>cs and rd are both integers - initially, cs = 100, and rd = 40. This should generate a random number between 7 and 25. However, I run into many problems in Xcode with this, due to the variable types. </p>
  
  <p>With this code, it initially shows the one error - On the first '*', it says:</p>
  
  <pre><code>'Int' is not convertible to 'UInt8'
  </code></pre>
  
  <p>But when I change that, it comes up with more problems, and it seems like I keep going round in a circle.</p>
  
  <p>What's going wrong, and how can i fix this?</p>