|
Author |
Topic: mistake in example-code (Read 1572 times) |
|
der_rabe
|
mistake in example-code
« on: Feb 19th, 2004, 10:02pm » |
|
i started processing 0.68 after i used the 0.67 version for some time and found a mistake in the code of the cellular automata no.1. Thats the original code. Code: // Set random cells to 'on' for (int i = 0; i < sx * sy * density; i++) { world[(int)random(sx)][(int)random(sy)][1] = 1; |
| i get an "indexOutOfBounds-exception". the same code works fine in the 0.67 version. i changed the code to: Code: // Set random cells to 'on' for (int i = 0; i < sx * sy * density; i++) { world[(int)random(sx-1)][(int)random(sy-1)][1] = 1; |
| now it works fine. is it possible, that you changed the inner functionality of the random() function?
|
Bernd Salewski student of digital media Hochschule Bremen
|
|
|
REAS
|
Re: mistake in example-code
« Reply #1 on: Apr 16th, 2005, 10:16am » |
|
please check this with the forthcoming BETA release. i'm not able to re-create your error on the previous release.
|
|
|
|
|