-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprogramming.html
More file actions
93 lines (80 loc) · 2.09 KB
/
programming.html
File metadata and controls
93 lines (80 loc) · 2.09 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Programming</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
body {
font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
Roboto, Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
background: #fafafa;
color: #222;
line-height: 1.6;
padding: 2rem;
}
.container {
max-width: 900px;
margin: auto;
}
.notice {
background: #fffbe6;
border-left: 4px solid #f5c542;
padding: 1rem;
margin-bottom: 2rem;
}
pre {
background: #f4f4f4;
padding: 1.25rem;
border-radius: 6px;
font-family: Consolas, Monaco, "Andale Mono", monospace;
font-size: 0.95rem;
position: relative;
overflow-x: auto;
}
.kw { color: #0000cd; font-weight: bold; }
.num { color: #d91e18; }
/*
This is the key trick:
- Invisible on screen
- Still present in selection & clipboard
*/
.copy-only {
position: absolute;
left: -9999px;
width: 1px;
height: 1px;
overflow: hidden;
}
textarea {
width: 100%;
min-height: 90px;
margin-top: 1rem;
font-family: Consolas, Monaco, monospace;
padding: 0.75rem;
}
footer {
margin-top: 3rem;
font-size: 0.85rem;
color: #666;
}
</style>
</head>
<body>
<div class="container">
<h1>Programming Reasoning Challenge</h1>
<pre id="challenge-code">
result = <span class="num">0</span>
<span class="kw">for</span> x <span class="kw">in</span> [<span class="num">3</span>, <span class="num">3</span>, <span class="num">5</span>]:
<span class="kw">if</span> x ><span class="copy-only">=</span> <span class="num">3</span>:
result = result - x
<span class="kw">else</span>:
result = result + x
</pre>
<p><strong>Question:</strong> What is the final value of <code>result</code>?</p>
<footer>
Reasoning > execution.
</footer>
</div>
</body>
</html>