Removed RegularRandom
Regular Random Stuff is not needed anymore, standard random results in a regular random tree now anyway because of the way the pythagoras triangle is implemented
This commit is contained in:
parent
b5ba27ce91
commit
d0e8874387
|
@ -5,23 +5,14 @@ import java.util.LinkedList;
|
|||
*/
|
||||
public class Numbers {
|
||||
LinkedList<Long> fibonacci = new LinkedList<Long>();
|
||||
LinkedList<Double> regularRandom = new LinkedList<Double>();
|
||||
|
||||
public Numbers() {
|
||||
fibonacci.add((long) 1);
|
||||
fibonacci.add((long) 1);
|
||||
regularRandom.add(Math.random());
|
||||
}
|
||||
|
||||
public long calcFibonacci(int index) {
|
||||
if (index < fibonacci.size()) return fibonacci.get(index);
|
||||
else return calcFibonacci(index - 1) + calcFibonacci(index - 2);
|
||||
}
|
||||
|
||||
public double getRegularRandom(int index){
|
||||
while (regularRandom.size() <= index) {
|
||||
regularRandom.add(Math.random());
|
||||
}
|
||||
return regularRandom.get(index);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ public class PythagorasTriangle {
|
|||
|
||||
|
||||
case RegularRandomPythagorasTree:
|
||||
leftAngle = numbers.getRegularRandom(momentaryDepth) * 50 + 20;
|
||||
leftAngle = Math.random() * 50 + 20;
|
||||
break;
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue