Not sure I follow what you are asking for but maybe start with this:
var TargetNumber = -1
function Randomize:
For Each Random Number
--If RandomNumber != TargetNumber
---Random Number = floor(Random(1,10))
Of course make sure you are familiar with Random(), Choose(), Floor(), Ceil()