nature-of-code / The-Nature-of-Code-archive

The very first build system for The Nature of Code
http://natureofcode.com
914 stars 151 forks source link

picking random element from array not clear #300

Closed shiffman closed 8 years ago

shiffman commented 11 years ago

int[] stuff = new int[5]; stuff[0] = 1; stuff[1] = 1; stuff[2] = 2; stuff[3] = 3; stuff[4] = 3;

int index = int(random(stuff.length)); // Picking a random element from an array

needs to have

int val = stuff[index];

or something

shiffman commented 8 years ago

fixed