-
Notifications
You must be signed in to change notification settings - Fork 1
/
random-mutations.html
121 lines (119 loc) · 2.87 KB
/
random-mutations.html
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Random mutations</title>
<meta name="description" content="Evolution doesn't need much" />
<!-- TODO -->
<!-- <link rel="icon" href="/icon.png" type="image/png"> -->
<style>
:root {
--mr-c-bg: white;
--mr-c-text-1: rgba(61, 61, 61);
--mr-c-text-2: rgba(61, 61, 61, 0.7);
--mr-c-accent-1: crimson;
--mr-c-accent-2: black;
}
@media (prefers-color-scheme: dark) {
:root {
--mr-c-bg: #111;
--mr-c-text-1: #ddd;
--mr-c-text-2: #888;
--mr-c-accent-1: chartreuse;
--mr-c-accent-2: white;
}
}
:root {
font-size: 18px;
}
body {
background-color: var(--mr-c-bg);
color: var(--mr-c-text-1);
font-family: system-ui, sans-serif;
margin-inline: 1rem;
margin-block: 2rem;
@media (min-width: 30rem) {
margin-inline: 2rem;
margin-block: 3rem;
}
}
div:has(pre) {
display: flex;
flex-wrap: wrap;
gap: 1em;
}
pre {
overflow-x: auto;
}
code {
font-size: 14px;
line-height: 1.4;
}
b {
color: var(--mr-c-accent-2);
}
b#mutation {
color: var(--mr-c-accent-1);
}
p {
margin-block: 2rem;
color: var(--mr-c-text-2);
font-size: 0.9rem;
max-width: 34rem;
line-height: 1.4;
}
footer {
margin-block: 3em;
font-size: 0.9rem;
a {
text-decoration: none;
color: var(--mr-c-text-2);
}
a:hover {
color: var(--mr-c-text-1);
}
}
</style>
</head>
<body>
<main>
<h3>Random mutations</h3>
<div class="code-blocks-container">
<pre><code>
def <b>d</b>fs(s, adj):
xs = [s]
visited = set()
while xs:
u = xs.pop()
if u not in visited:
print(u)
visited.add(u)
for v in adj.get(u, []):
xs.append(v)
</code></pre>
<pre><code>
def <b>b</b>fs(s, adj):
xs = [s]
visited = set()
while xs:
u = xs.pop(<b id="mutation">0</b>)
if u not in visited:
print(u)
visited.add(u)
for v in adj.get(u, []):
xs.append(v)
</code></pre>
</div>
<p>
Tiny, single letter mutations are enough for evolution to explore vast
landscapes. A demonstration using code, but the same mechanism is at
play with DNA – a single amino-acid mutation can express an entirely
different function, and organism.
</p>
</main>
<footer>
<a href="/">/</a>
</footer>
</body>
</html>