-
Notifications
You must be signed in to change notification settings - Fork 0
/
18th_aug_runology
89 lines (50 loc) · 1.85 KB
/
18th_aug_runology
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
import { repeat_pattern, stack, rcross, sail, corner, nova, pink, heart, show, stackn, red, quarter_turn_right} from "rune";
// transformation
show(red(sail));
show(quarter_turn_right(red(heart)));
show(sail);
function turn_upside_down(rune){
return quarter_turn_right(quarter_turn_right(rune));
}
function quarter_turn_left(rune){
return quarter_turn_right(turn_upside_down(rune));
}
show(quarter_turn_right(turn_upside_down(heart)));
show(quarter_turn_left(heart));
// stack
show(stack(quarter_turn_left(heart), quarter_turn_left(heart)));
function beside2(rune1, rune2){
return quarter_turn_right(stack(quarter_turn_left(rune1), quarter_turn_left(rune2)));
}
show(beside2(heart,nova));
// first one is right and second left because of the rotation
// if we switch the rotation:
function beside(rune1, rune2){
return quarter_turn_left(stack(quarter_turn_right(rune1), quarter_turn_right(rune2)));
}
show(beside(heart,nova));
// stackn
show(stackn(15, corner));
const my_quilt =
stackn(11,
quarter_turn_right(
stackn(18, quarter_turn_left(nova))));
show(my_quilt);
// rows*columns
function quilt(m,n, rune){
return stackn(m,
quarter_turn_right(
stackn(n, quarter_turn_left(rune))));
}
show(quilt(20,10,pink(heart)));
// cool stuff
function make_cross(rune){
return stack(beside(quarter_turn_right(rune),turn_upside_down(rune)), beside(rune, quarter_turn_left(rune)));
}
show(make_cross(rcross));
show(make_cross(make_cross(rcross)));
// repeat pattern to repeat transformation - 3 arguments
show(repeat_pattern(3, quarter_turn_right, heart));
show(repeat_pattern(3, make_cross, rcross));
// power of abstraction - once we give soemthing a name we dont have to understand how to use it after that
// abstraction allows to master complexity