Loading...
Processing Forum
Recent Topics
All Forums
Screen name:
alephzero
alephzero's Profile
1
Posts
1
Responses
0
Followers
Activity Trend
Last 30 days
Last 30 days
Date Interval
From Date :
To Date :
Go
Loading Chart...
Posts
Responses
PM
Show:
All
Discussions
Questions
Expanded view
List view
Private Message
Implement trees in Processing
[4 Replies]
24-Mar-2013 04:27 AM
Forum:
Programming Questions
Hi, I'm trying to implement trees in Processing recursively.
Here is the class I defined :
class Tree {
int page;
ArrayList next = new ArrayList();
Arbre precedent = new Arbre(-1);
Arbre(int p) {
page = p;
}
void addTreeSon(Tree son) {
son.precedent = this;
next.add(son);
}
void addElementSon(int n) {
Tree son = new Tree(n);
son.precedent = this;
next.add(son);
}
Unfortunately, if I call this class:
Tree t = new Tree(0);
I get the following error message: This sketch is attempting too much recursion.
It's the first time I've been trying recursivity in Processing, could someone help me solve this problem ?
Thank you very much !
«Prev
Next »
Moderate user : alephzero
Forum