I couldn't figure it out, as I need the x position to be within 20-100ish otherwise it was going outside the playfield, and getting stuck by the collision. Tried using some while / if statements to get the number in the range but it wouldn't work. By hey, a perfect reason for displaying the generated code!
Having a random number return between [num] and [num] would be perfect.