Watch. Turn on turbo mode (green flag + shift) and put style to 0-1 to for a satisfying result If you have a higher speed, I recommend turning the line off for a more satisfying result How it works: 1) A list of numbers 1-48 get generated in a random order, the A.I only has access to the current bar it's on and the bar behind it. 2) The numbers get drawn onto the screen in the order. 3) The A.I. starts at bar #2 tests to see if the current bar it's on is bigger than the one behind it, if so it switches the bar its currently on and the bar behind it then goes back one. 4) The A.I. continuously checks to see if the current bar it's on is bigger than the one behind it. If it is the A.I switches the bar then moves back one but if it isn't the A.I moves up one. 5) The A.I. continues the algorithm until all the bars are in order.
All code by me. Project inspired by https://scratch.mit.edu/projects/149793697/ The type of sorting is called bubble sorting