1
0
Fork 0

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:
Jan Christian Grünhage 2015-02-11 10:54:17 +01:00
parent b5ba27ce91
commit d0e8874387
2 changed files with 1 additions and 10 deletions

View File

@ -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);
}
}

View File

@ -25,7 +25,7 @@ public class PythagorasTriangle {
case RegularRandomPythagorasTree:
leftAngle = numbers.getRegularRandom(momentaryDepth) * 50 + 20;
leftAngle = Math.random() * 50 + 20;
break;