aUCBLogo Demos and Tests / breaktest
to breaktest
; repeat 10 [pr # if #==5 [continueLoop] pr "so]
; repeat 10 [pr # if #==5 [break] pr "so]
; repeat 10 [pr # if #==5 [break]]
; repeat 10 [pr #]
; while [# < 10][pr # if #==5 [continueLoop] pr "so]
; while [# < 10][pr # if #==5 [break] pr "so]
; while [# < 10][pr # if #==5 [break]]
; until [# >= 10][pr # if #==5 [continueLoop] pr "so]
; until [# >= 10][pr # if #==5 [break] pr "so]
; until [# >= 10][pr # if #==5 [break]]
; do_while [pr # if #==5 [continueLoop] pr "so][# < 10]
; do_while [pr # if #==5 [break] pr "so][# < 10]
; do_while [pr # if #==5 [break]][# < 10]
; do_until [pr # if #==5 [continueLoop] pr "so][# >= 10]
; do_until [pr # if #==5 [break] pr "so][# >= 10]
; do_until [pr # if #==5 [break]][# >= 10]
; for [i 1 10][pr i if i==5 [continueLoop] pr "so]
; for [i 1 10][pr i if i==5 [break] pr "so]
; for [i 1 10][pr i if i==5 [break]]
; for [i 1 1][pr "so]
; for [i 1.1 10.1][pr i if i==5.1 [continueLoop] pr "so]
; for [i 1.1 10.1][pr i if i==5.1 [break] pr "so]
; for [i 1.1 10.1][pr i if i==5.1 [break]]
; for [i 1.1 1.1][pr "so]
; foreach [1 2 3 4 5 6 7 8 9 10][pr # if #==5 [continueLoop] pr "so]
; foreach [1 2 3 4 5 6 7 8 9 10][pr # if #==5 [break] pr "so]
; foreach [1 2 3 4 5 6 7 8 9 10][pr # if #==5 [break]]
pr 10
end