"Script Nou" - Processing

ID Autor Duplicat din Ultima modificare
#5763 Andrei Dragoș (AndreiDragosDavid) - Marti, 07 nov 2023, 18:26
x
 
1
let values = [];
2
let states = [];
3
4
function setup() {
5
  createCanvas(710, 400);
6
  for(let i = 0; i < width/8; i++) {
7
    values.push(random(height));
8
    states.push(-1);
9
  }
10
  quickSort(0, values.length - 1);
11
}
12
13
function draw() {
14
  background(140);
15
  for(let i = 0; i < values.length; i++) {
16
    if (states[i] == 0) {
17
      // pivot
18
      fill('#E0777D');
Du-te sus!