[ Back to the overview Matrix ]

Test case : Bubble sort using Foo

Lines used: 9
         
('a = ((25 times+ ((:input >>) :- (? break))) array))
('i = 1)
(? loop
   ((i >= (a length)) when (? break))
   (((a at (i - 1)) > (a at i)) when
    (a swap (i - 1) i)
    ('i = 0))
   ('i ++))
(? . (a list))
If not bound by above bubble sort algorithm, the problem could also be solved with
    
(? . ((25 times+ ((:input >>) :- (? break))) sort!))
Contributed by Guillaume, google at memoire.com