summaryrefslogtreecommitdiff
path: root/ipl/procs/lterps.icn
blob: a8ac521cca1e1b277267e97c3223b41603aafb8f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
############################################################################
#
#	File:     lterps.icn
#
#	Subject:  Procedure to interpret L-system output
#
#	Author:   Ralph E. Griswold
#
#	Date:     September 30, 2001
#
############################################################################
#
#  This file is in the public domain.
#
############################################################################
#
#  Links:  numbers
#
############################################################################

link numbers

procedure seqterp(s)			#: interpret L-system output
   local c
   static incr, pos

   initial {
      incr := 1
      pos := 0
      }

   every c := !s do
      case c of {
         "F"  :  {
            pos +:= incr
            suspend pos
            }
         "f"  :  pos +:= incr
         "+"  :  incr := 1
         "-"  :  incr := -1
         }

end