I have a problem to ask

You have declared the array contenitore twice in the first two lines. So delete the first line.

The ‘=’ sign is the assignment operator, it means evaluate what is on the right-hand-side and store it in the variable on the left-hand-side. The data types for both sides must be the same. So

won’t work because contenitore is an array of booleans and the RHS returns a float

replacing it with contenitore[i] = random(100); won’t work because contenitore[i] is a boolean and random(100) returns a float.

As @kfrager points out you can’t have code outside of a function.

I suggest you look at the examples and simple tutorials for Processing so you understand how code is supposed to be organised. In particular look at the tutorial on setup() and draw().

This is your first time here so I will give you a hint on how to get better help.

Statements like

and

are useless because they don’t say what is wrong or what the error is. You need to give much more information on what you expected to happen, what actually happened and details of any error messages.

BTW welcome to the forum :smile:

1 Like