Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

control-flow.l2 542B

123456789101112131415161718192021222324252627282930313233343536373839
  1. print "Run loop 10 times"
  2. i := 0
  3. loop {
  4. print "Hello World"
  5. i = i + 1
  6. if i >= 10 {'stop}
  7. }
  8. print "\nWith while this time"
  9. i := 0
  10. while {i < 10} {
  11. print "Hallo Wrodl"
  12. i = i + 1
  13. }
  14. print "\nAnd with the for loop"
  15. i := 0
  16. iter := {
  17. j := i
  18. i = i + 1
  19. if j < 10 {j} {'stop}
  20. }
  21. for iter { print "Hello with" $ }
  22. print "\nArray iterator"
  23. array-iter := {
  24. arr := $.0
  25. idx := 0
  26. {
  27. if idx >= (len arr) {
  28. 'stop
  29. } {
  30. j := idx
  31. idx = idx + 1
  32. [j arr.(j)]
  33. }
  34. }
  35. }
  36. for (array-iter ["hello" "world" "how" "are" "you" 10 20 'true]) print