Merge branch 'master' of https://git.baipyr.us/Baipyrus/SortingAlgorithms
This commit is contained in:
commit
087976067a
|
@ -2,7 +2,7 @@ final float timeout = 2.5;
|
|||
|
||||
ArrayList<Integer> bars = new ArrayList<Integer>();
|
||||
ArrayList<Job> queue = new ArrayList<Job>();
|
||||
int mQL = 1, aQL = 0, amount = 1000;
|
||||
int mQL = 1, aQL = 0, amount;
|
||||
float barWidth;
|
||||
|
||||
int sortedFrameCountCapture = -1;
|
||||
|
@ -11,14 +11,14 @@ void setup() {
|
|||
fullScreen(P3D);
|
||||
// size(1280, 720);
|
||||
|
||||
// amount = floor(random(50, 500));
|
||||
amount = floor(random(50, 500));
|
||||
barWidth = (float)width / amount;
|
||||
for (int i = 0; i < amount; i++) {
|
||||
bars.add(round(random(height * 0.1, height * 0.9)));
|
||||
}
|
||||
queue.add(new Job(0, amount-1));
|
||||
|
||||
frameRate(1000);
|
||||
frameRate(amount);
|
||||
}
|
||||
|
||||
void draw() {
|
||||
|
@ -42,7 +42,8 @@ void draw() {
|
|||
}
|
||||
}
|
||||
// line(i, height, i, height-bars.get(i));
|
||||
rect(i * barWidth, height, barWidth, -bars.get(i));
|
||||
// rect(i * barWidth, height, barWidth, -bars.get(i));
|
||||
ellipse(i * barWidth + barWidth / 2, height - bars.get(i), barWidth, barWidth);
|
||||
}
|
||||
|
||||
/*if (queue.size() > 0) {
|
||||
|
@ -58,7 +59,7 @@ void draw() {
|
|||
} else if (frameCount-sortedFrameCountCapture>=round((amount/2)*timeout)) {
|
||||
sortedFrameCountCapture = -1;
|
||||
|
||||
// amount = floor(random(50, 500));
|
||||
amount = floor(random(50, 500));
|
||||
barWidth = (float)width / amount;
|
||||
bars = new ArrayList<Integer>();
|
||||
for (int i = 0; i < amount; i++) {
|
||||
|
@ -69,7 +70,7 @@ void draw() {
|
|||
mQL = 1;
|
||||
aQL = 0;
|
||||
|
||||
frameRate(1000);
|
||||
frameRate(amount);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user