>>432 Squeak/Pharo Smalltalk

| simpleBubble |

simpleBubble := [:arr |
 | stream |
 stream := arr readStream.
 arr size - 1 timesRepeat: [
  arr size - 1 timesRepeat: [
   stream next > stream peek ifTrue: [
    arr swap: stream position with: stream position + 1]].
  stream reset
 ].
 arr
].

simpleBubble value: (1 to: 10) asArray shuffled "=> #(1 2 3 4 5 6 7 8 9 10) "