Add tasks for all the new languages
This commit is contained in:
parent
9dc3c2bb62
commit
bba7bfd280
13208 changed files with 134745 additions and 0 deletions
|
|
@ -0,0 +1,31 @@
|
|||
class BubbleSort
|
||||
**Sort a list with the Bubble Sort algorithm**
|
||||
|
||||
on start
|
||||
|
||||
args := program arguments
|
||||
.sort(args)
|
||||
print args
|
||||
|
||||
define sort(list) is shared
|
||||
**Sort the list**
|
||||
|
||||
test
|
||||
list := [4, 2, 7, 3]
|
||||
.sort(list)
|
||||
assert list = [2, 3, 4, 7]
|
||||
|
||||
body
|
||||
last := list.count - 1
|
||||
|
||||
post while changed
|
||||
|
||||
changed := false
|
||||
|
||||
for i in last
|
||||
|
||||
if list[i] > list[i + 1]
|
||||
temp := list[i]
|
||||
list[i] := list[i + 1]
|
||||
list[i + 1] := temp
|
||||
changed := true
|
||||
Loading…
Add table
Add a link
Reference in a new issue