Stage::pickRandom()
Picks a random number between the two limits.
Examples
import org.openpatch.scratch.*;
public class StagePickRandom {
public StagePickRandom() {
Stage myStage = new Stage(600, 240);
while (myStage.getTimer().forMillis(3000)) {
int random = myStage.pickRandom(0, 100);
myStage.display("Random: " + random);
myStage.wait(500);
}
myStage.exit();
}
public static void main(String[] args) {
new StagePickRandom();
}
}
Syntax
Java
.pickRandom(min, max)
Scratch
Parameters
Name | Data Type | Description |
---|---|---|
min | int | Minimal integer. |
max | int | Maximal integer. |
Return
int