FANDOM


A VM instruction generates a random integer between 0 (inclusive) and some integer upper bound (exclusive), and stores the result in a memory location.

Usage Edit

rnd: [{store location}, {integer}]

hakkML Example Edit

name: rnd_example
blocks:
  core:
  entry: {name: 'main', loc: [0,1]}
code:
  main:
    - rem: generate a random number between 0 and 9
    - rnd: [core.0, 10]
    - rem: send the result to STDOUT
    - out: core.0
    - exit: 0