FAQ
Cover
This is the archive Discourse for the Processing (ALPHA) software.
Please visit the new Processing forum for current information.

   Processing 1.0 _ALPHA_
   Bugs
   Website, Reference, Example Bugs
(Moderator: REAS)
   mistake in example-code
« No topic | Next topic »

Pages: 1 
   Author  Topic: mistake in example-code  (Read 1572 times)
der_rabe

343748541343748541 WWW
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


WWW
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.
 
Pages: 1 

« No topic | Next topic »