Bubble 😋

bubble :face_savoring_food:

Cant load it but

bubble :face_savoring_food: ig
new yum?

it just takes a really long time

just don’t do anything and it won’t crash

Everyone make a Bubble :face_savoring_food:

Do you know which algorithm I would use to sort different sized bubbles?

🫧
for ((i)) = (([length V] of (bubbles)) - (1)) to (1) {
for ((j)) = (1) to (i) {
if <(item (j) of (bubbles)) > (item ((j) + (1)) of (bubbles))> {
script variables ((temp))
set [temp V] to (item (j) of (bubbles))
replace item (j) of (bubbles) with (item ((j) + (1)) of (bubbles))
replace item ((j) + (1)) of (bubbles) with (temp::variables)
}
}
}

let size #1 = list( );
let size #2 = list( );
let size #3 = list( );
if (bubble size = > < 1#) {
add (bubble name) to size#1
};
if (bubble size = > < 2#) {
add (bubble name) to size#2
};
if (bubble size = > < 3#) {
add (bubble name) to size#3
};

is how i would do it personally, what u got is too advanced 4 me to understand

His algorithm SORTS a list. The name of the algorithm used is “bubble sort”, hence the bubbles.

too advanced…

This is nice, I’m just wondering why this project took over 4 minutes to load.

i sneaked in a couple of trojans

I’m struggling to see the point of putting a picture of some random wall in Snap!'s costume library.

(Although it is good for a background for bubbles I suppose) “Suppose” sounds so old-fashioned.

i goes from the end to the beginning.
j goes from the beginning to i.
If bubbles[j] > the next one, swap them.
The reason why i can go to the beginning:
the biggest bubble will be encountered by j,
and as j goes to the end, the biggest bubble will also go there.

i see

Breaking idea: Clones

I just thought of an interesting idea: double-recursive bubble sort in C (I have not tested this idea)

void dbl_rec_bub(int list[], int len) {
  if(len < 2) return;
  if(list[0] > list[1]) {
    int temp = list[0];
    list[0] = list[1];
    list[1] = temp;
  }
  dbl_rec_bub(list + 1, len - 1);
  dbl_rec_bub(list, len - 1);
}

Snap! equivalent:

{double recursive bubble sort ((list)) ((length)) :: list} :: hat
if <(length) < (2)> {
stop [this block V]
}
if <(item (1 v) of (list)) > (item (2 v) of (list))> {
script variables ((temp))
set [temp V] to (item (1 v) of (list))
replace item (1 v) of (list) with (item (2 v) of (list))
replace item (2 v) of (list) with (temp :: variables)
}
double recursive bubble sort (all but first of (list)) ((length) - (1)) :: list
double recursive bubble sort (list) ((length) - (1)) :: list

oh wait no he project is big because you put every library known to man into it
why

There literally is every library in that project.

(That’s kind of funny actually)