*** Select one sprite that should be the origin of array.

// Parameter list begins
mov r99 512 // Total number of sprites
mov r98 8192 // Maximal distance from origin
mov r97 512 // Distance bias
// Parameter list ends
~~~ Default parameters:
~~~ mov r99 512 // Total number of sprites
~~~ mov r98 8192 // Maximal distance from origin
~~~ mov r97 512 // Distance bias
getfirstselectedsprite r00
getsprite r00 x r01
getsprite r00 y r02
while r99 > 0
  dec r99
  rnd r03 // Assign random value
  and r03 2147483647 // Only positive values
  div r03 16384
  mod r03 r98
  add r03 r97
  rnd r06 // Assign random value
  and r06 2147483647 // Only positive values
  div r06 32768
  cos r04 r06
  sin r05 r06
  mul r04 r03
  mul r05 r03
  div r04 65536
  div r05 65536
  add r04 r01
  add r05 r02
  getspritenumber r07  inc r07
  setspritenumber r07  dec r07
  setsprite r07 = r00
  setsprite r07 x r04
  setsprite r07 y r05
  div r06 32
  add r06 512
  and r06 2047
  setsprite r07 ang r06
continue