on 492ae2f help sign in
49 lines 739 B history raw
2### `++lust`
4Detect newline
6Advances the `++hair` `naz` by a row if the `++char` `weq` is a newline, or by a
7column if `weq` is any other character.
9Accepts
10-------
12`weq` is a char.
14`naz` is a hair.
16Produces
17--------
19A hair.
21Source
22------
24 ++ lust |= {weq/char naz/hair} :: detect newline
25 ^- hair
26 ?:(=(`@`10 weq) [+(p.naz) 1] [p.naz +(q.naz)])
30Examples
31--------
33 ~zod/try=> (lust `a` [1 1])
34 [p=1 q=2]
35 ~zod/try=> (lust `@t`10 [1 1])
36 [p=2 q=1]
37 ~zod/try=> (lust '9' [10 10])
38 [p=10 q=11]
39 /~zod/try=> (roll "maze" [.(+<+ [1 1])]:lust)
40 [1 5]
41 /~zod/try=> %- roll :_ [.(+<+ [1 1])]:lust
42 """
43 Sam
44 lokes
45 """
46 [2 6]
49***