Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit70353cc

Browse files
authored
Merge pull requestalexmojaki#287 from alexmojaki/debugger-terms
Style snoop and birdseye as code
2 parents8e55e3f +aa01b8a commit70353cc

File tree

11 files changed

+54
-52
lines changed

11 files changed

+54
-52
lines changed

‎core/chapters/c05_if_statements.py‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,8 @@ def program(self):
210210

211211

212212
classUnderstandingProgramsWithSnoop(Page):
213+
title="Understanding Programs With `snoop`"
214+
213215
classprint_tail(print_tail_base):
214216
"""
215217
Run this program:
@@ -228,15 +230,15 @@ class print_tail(print_tail_base):
228230
classprint_tail_snoop(print_tail_base):
229231
"""
230232
Programs are starting to get complicated!
231-
It's time to introduce a new tool to help you understand programs. Click the'Snoop' button to run the same program while also showing what's happening.
233+
It's time to introduce a new tool to help you understand programs. Click the`snoop` button to run the same program while also showing what's happening.
232234
"""
233235

234236
program_in_text=False
235237
expected_code_source="snoop"
236238

237239
classprint_first_character(ExerciseStep):
238240
"""
239-
Tada! Scroll to the top of the terminal and let's walk through what snoop is showing you.
241+
Tada! Scroll to the top of the terminal and let's walk through what`snoop` is showing you.
240242
It starts out very straightforward:
241243
242244
1 | sentence = 'Hello World'
@@ -248,9 +250,9 @@ class print_first_character(ExerciseStep):
248250
The first lines are simply showing you the lines of the program that the computer ran.
249251
On the left is the line number as seen in the editor.
250252
251-
Running `for char in sentence:` assigns a value to the variable `char`, so snoop shows you that value.
253+
Running `for char in sentence:` assigns a value to the variable `char`, so`snoop` shows you that value.
252254
Lines starting with `......` indicate a new variable or a change in the value of an existing variable.
253-
Such lines will not be shown when they're redundant, which is why the snoop output doesn't start like this:
255+
Such lines will not be shown when they're redundant, which is why the`snoop` output doesn't start like this:
254256
255257
1 | sentence = 'Hello World'
256258
...... sentence = 'Hello World'

‎core/chapters/c06_lists.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ def generate_inputs(cls):
379379
break
380380
381381
This is just as correct but skips unnecessary iterations and checks once it finds the element.
382-
You can use snoop to see the difference.
382+
You can use`snoop` to see the difference.
383383
"""
384384

385385

‎core/chapters/c08_nested_loops.py‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1102,13 +1102,13 @@ def solution(self, players: List[str]):
11021102

11031103

11041104
classIntroducingBirdseye(Page):
1105-
title="Understanding Programs withBird's Eye"
1105+
title="Understanding Programs with`birdseye`"
11061106

11071107
classfirst_birdseye_example(VerbatimStep):
11081108
"""
1109-
You've seenSnoop and Python Tutor. futurecoder comes with one last tool to analyse programs as they run, called*Bird's Eye*.
1109+
You've seen`snoop` and Python Tutor. futurecoder comes with one last tool to analyse programs as they run, called`birdseye`.
11101110
1111-
Here's an example program to run. Copy it into the editor and click theBird's Eye button. This will open a new browser tab with the visualisation.
1111+
Here's an example program to run. Copy it into the editor and click the`birdseye` button. This will open a new browser tab with the visualisation.
11121112
11131113
__copyable__
11141114
__program_indented__
@@ -1125,13 +1125,13 @@ def program(self):
11251125

11261126
classbirdseye_loop_example(VerbatimStep):
11271127
"""
1128-
While the other tools show how code runs line by line and the values of variables,Bird's Eye shows you the value of every expression in a program. This lets you see how a complex expression is broken down into smaller sub-expressions
1128+
While the other tools show how code runs line by line and the values of variables,`birdseye` shows you the value of every expression in a program. This lets you see how a complex expression is broken down into smaller sub-expressions
11291129
and what the value of each one is.
11301130
11311131
Hover your mouse over the various boxed expressions in the last line of the program.
11321132
As each box is highlighted, its value is shown at the bottom of the screen. Clicking on the box will stick it on a panel so you can see several expression values at once and move your mouse around freely.
11331133
1134-
In this caseBird's Eye shows that the expression:
1134+
In this case`birdseye` shows that the expression:
11351135
11361136
a * b + c * d
11371137
@@ -1145,7 +1145,7 @@ class birdseye_loop_example(VerbatimStep):
11451145
11461146
In other words, Python follows the usual order of operations in maths, rather than just evaluating from left to right.
11471147
1148-
Note that there are some expressions thatBird's Eye doesn't put in a box. In this case `2`, `3`, `4`, `5`, and `print` are all expressions as well, but their values are obvious and boxing them would just be clutter.
1148+
Note that there are some expressions that`birdseye` doesn't put in a box. In this case `2`, `3`, `4`, `5`, and `print` are all expressions as well, but their values are obvious and boxing them would just be clutter.
11491149
11501150
Here's a more complicated example to try out:
11511151

‎core/chapters/c09_functions.py‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -292,15 +292,15 @@ class see_stack_in_snoop(print_twice_call_print_many):
292292
It's important to get a good sense of what's going on here and to know how
293293
to explore function calls, so we're going to try this out in each debugger.
294294
295-
First, run the program again withSnoop.
295+
First, run the program again with`snoop`.
296296
"""
297297

298298
expected_code_source="snoop"
299299
program_in_text=False
300300

301301
classsee_stack_in_pythontutor(print_twice_call_print_many):
302302
text="""
303-
Snoop starts each function call with:
303+
`snoop` starts each function call with:
304304
305305
1. A new level of indentation in the logs.
306306
2. `>>> Call to <function name>`
@@ -325,14 +325,14 @@ class see_stack_in_birdseye(print_twice_call_print_many):
325325
the top level frame where the whole program is running. As you click Next, new frames appear
326326
and then disappear. In each one you can see the values of the variables.
327327
328-
Finally, run the program withBird's Eye.
328+
Finally, run the program with`birdseye`.
329329
"""
330330

331331
expected_code_source="birdseye"
332332
program_in_text=False
333333

334334
final_text="""
335-
Bird's Eye only shows one frame (function call) at a time. At first you see the global frame.
335+
`birdseye` only shows one frame (function call) at a time. At first you see the global frame.
336336
At the bottom is the call to `print_twice`. Click on the little blue arrow to take
337337
you into that frame, and then click on the next one to enter `print_many`.
338338
"""
@@ -763,7 +763,7 @@ class return_ends_whole_function(VerbatimStep):
763763
"""
764764
At first it may look intuitive to `return` one value for each iteration in a `for` loop.
765765
But it doesn't work like that!
766-
If you inspect the code withSnoop or Python tutor you can see that the function returns 2 in the first
766+
If you inspect the code with`snoop` or Python tutor you can see that the function returns 2 in the first
767767
loop iteration and then ends immediately.
768768
769769
Even when there's only one `return` statement, it will get executed only once and return one value.

‎core/chapters/c10_boolean operators.py‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,15 +174,15 @@ class InspectWithBirdseye(ACommonMistake):
174174
text="""
175175
The second and third tests fail! Our function seems to be doing the wrong thing:
176176
it returns `"Bob"` (a string, not a boolean!) when `name` is `"Bob"` or `"Charlie"`. What is going on?
177-
Try inspecting the code withBird's Eye. Inspect the `return` statements of each `is_friend` call carefully.
177+
Try inspecting the code with`birdseye`. Inspect the `return` statements of each `is_friend` call carefully.
178178
(Use the blue arrow buttons)
179179
"""
180180

181181
expected_code_source="birdseye"
182182

183183
classAnExercise(ExerciseStep):
184184
"""
185-
When we inspect it withBird's Eye, we can see that:
185+
When we inspect it with`birdseye`, we can see that:
186186
187187
name == "Alice" or "Bob"
188188
@@ -705,7 +705,7 @@ class NotFalse(VerbatimStep):
705705

706706
classNotTrueOrTrue(VerbatimStep):
707707
"""
708-
What is the priority of `not` compared to `and` and `or`? Try the following inBird's Eye:
708+
What is the priority of `not` compared to `and` and `or`? Try the following in`birdseye`:
709709
710710
__program_indented__
711711
"""
@@ -718,7 +718,7 @@ def program(self):
718718

719719
classNotPriority(ExerciseStep):
720720
"""
721-
You can see inBird's Eye that
721+
You can see in`birdseye` that
722722
723723
not True or True
724724

‎core/chapters/c11_tic_tac_toe_project.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1433,7 +1433,7 @@ class nested_assignment_input(ExerciseStep):
14331433
14341434
The two pieces of code are pretty much exactly equivalent. Python first evaluates
14351435
`board[1]` to *get* the inner list, while the `[0] = ...` sets an element of `board[1]`.
1436-
You can see the value of `board[1]` inBird's Eye because it's an expression,
1436+
You can see the value of `board[1]` in`birdseye` because it's an expression,
14371437
and you could actually replace it with any other expression.
14381438
14391439
Now you know how to set elements in nested lists, it's time to make this interactive!

‎core/translation.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ class Terms:
251251
"Type your code directly in the shell after `>>>` and press Enter."
252252
)
253253
expected_mode_birdseye= (
254-
"With your code in the editor, click theBird's Eye button."
254+
"With your code in the editor, click the`birdseye` button."
255255
)
256256
expected_mode_snoop="With your code in the editor, click the Snoop button."
257257
expected_mode_pythontutor= (

‎frontend/src/App.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ const EditorButtons = (
8484
className="btn btn-success"
8585
onClick={()=>runCode({source:"snoop"})}
8686
>
87-
<FontAwesomeIconicon={faBug}/>Snoop
87+
<FontAwesomeIconicon={faBug}/><spanstyle={{fontFamily:"monospace"}}>snoop</span>
8888
</button>}
8989

9090
{" "}
@@ -136,7 +136,7 @@ const EditorButtons = (
136136
alt="birdseye logo"
137137
style={{position:"relative",top:"-2px"}}
138138
/>
139-
Bird's Eye
139+
<spanstyle={{fontFamily:"monospace"}}> birdseye</span>
140140
</button>}
141141

142142
{" "}

‎tests/golden_files/en/test_transcript.json‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1203,7 +1203,7 @@
12031203
"step":"for_inside_if"
12041204
},
12051205
{
1206-
"page":"Understanding Programs WithSnoop",
1206+
"page":"Understanding Programs With<code>snoop</code>",
12071207
"program": [
12081208
"sentence = 'Hello World'",
12091209
"",
@@ -1240,7 +1240,7 @@
12401240
"step":"print_tail"
12411241
},
12421242
{
1243-
"page":"Understanding Programs WithSnoop",
1243+
"page":"Understanding Programs With<code>snoop</code>",
12441244
"program": [
12451245
"sentence = 'Hello World'",
12461246
"",
@@ -1472,7 +1472,7 @@
14721472
"",
14731473
"print(new_sentence)"
14741474
],
1475-
"page":"Understanding Programs WithSnoop",
1475+
"page":"Understanding Programs With<code>snoop</code>",
14761476
"program": [
14771477
"sentence = 'Hello there'",
14781478
"include = True",
@@ -4629,7 +4629,7 @@
46294629
"step":"player_vs_player_bonus"
46304630
},
46314631
{
4632-
"page":"Understanding Programs withBird's Eye",
4632+
"page":"Understanding Programs with<code>birdseye</code>",
46334633
"program": [
46344634
"a = 2",
46354635
"b = 3",
@@ -4650,7 +4650,7 @@
46504650
"step":"first_birdseye_example"
46514651
},
46524652
{
4653-
"page":"Understanding Programs withBird's Eye",
4653+
"page":"Understanding Programs with<code>birdseye</code>",
46544654
"program": [
46554655
"word = 'Amazing'",
46564656
"vowels = []",

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp