-
Notifications
You must be signed in to change notification settings - Fork 0
/
prog
48 lines (44 loc) · 741 Bytes
/
prog
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
44
45
46
47
48
"bezqs {
pushdict
"dcy defx "dcx defx "steps defx "y defx "x defx "cy defx "cx defx
"steps @
dup
{
dup
dup
"dcx @ * "cx @ + swap "dcy @ * "cy @ + "x @ "y @ dq
"x @ -1 * "y @ -1 * dm
1 -
dup
} while
drop
"x @ "y @ dm
popdict
} subprog def
"slot {
pushdict
"times defx "de defx "ds defx "y defx "x defx
"times @
dup
{
dup
dup
"de @ * "x @ + "y @ dl
-1 "de @ * * "x @ - "ds @ - "y @ -1 * dm
1 -
dup
} while
drop
popdict
} subprog def
100 200 dM
100 200 2 20 20 "slot @ call
path
500 300 dM
-100 100 -10 -18 20 "slot @ call
path
100 100 dM
50 -25 200 50 3 25 -25 "bezqs @ call
50 50 200 50 3 25 25 "bezqs @ call
25 -25 200 50 3 25 -25 "bezqs @ call
path stop