Numbers

version 1 by Krister Fundin

  • Home page
  • Beginning
  • Previous
  • Next



  • Part 3 - Repeating

    To repeat with (N - nonexisting K variable) running from (low - an arithmetic value of kind K) to (high - K) in steps of (step - K) begin -- end:
        (- for ({N} = {low} : {N} <= {high} : {N} = {N} + {step}) -).

    To repeat with (N - nonexisting K variable) running backwards from (high - an arithmetic value of kind K) to (low - K) begin -- end:
        (- for ({N} = {high} : {N} >= {low} : --{N}) -).

    To repeat with (N - nonexisting K variable) running backwards from (high - an arithmetic value of kind K) to (low - K) in steps of (step - K) begin -- end:
        (- for ({N} = {high} : {N} >= {low} : {N} = {N} - {step}) -).

    To repeat (N - a number) times begin -- end:
        (-{-push-ctvs}for (ct_0 = {N} : ct_0 > 0 : --ct_0) -).

    To repeat forever begin -- end:
        (- for (::) -).