Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
ericbusboom committed Aug 28, 2024
1 parent 64efdc4 commit 3d6d701
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 9 deletions.
22 changes: 19 additions & 3 deletions lessons/00_Turtles/01_Get_Started.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@
"* Notebook files end with `.ipynb`. These files are very special, because they are both \n",
" documents and have programs that you can run. \n",
"\n",
"## Run Notebook Code Cells\n",
"\n",
"Notice that this file, ``01_Get_Started.ipynb`` is a Notebook file. If you are reading\n",
"the file in Visual Studio Code, you will see \"⏩ Run All\" at the top of the screen, \n",
"and some paragraphs that have code will have a \"▶️\" on the left side. \n",
Expand Down Expand Up @@ -133,14 +135,28 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Now let's run a Python program, which is in the file named ``02_Meet_Tina.py``. \n",
"## Run `.py` programs\n",
"\n",
"The files that end in `.py` are normal Python program, and the type of program you will \n",
"run most often. Now let's run a Python program, which is in the file named ``02_Meet_Tina.py``. \n",
"\n",
" To run the program:\n",
"There are a few ways to do this:\n",
"\n",
"### Use the ▶️ button\n",
"\n",
"1. Click on the file name to open the file\n",
"2. Look in the upper right for these icons: <img style=\"vertical-align:middle\" src=\"https://images.jointheleague.org/vscode/run_buttons.png\" height=\"25px\" > \n",
" click on the ▶️ run button to run the program. \n",
"3. Click on the window to close it. \n"
"3. Click on the window to close it. \n",
"\n",
"### Hit the F5 Key\n",
"\n",
"You can also run the program by hitting the F5 key. On a Mac, you will have to hold down the fn key and then hit F5. \n",
"\n",
"\n",
"<div class=\"alert alert-warning\">\n",
" You can't run a program again until you end the currently running program. If you see a turtle window open, then you should either click on the window to close it ( if the program ends with `turtle.exitonclick()` or click on the X in the upper right of the turtle window. )\n",
"</div>"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion lessons/00_Turtles/02_Meet_Tina.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
tina.pendown()
tina.color('red') # Set the color of tina to red
tina.begin_fill()
tina.circle(100, steps=50)
tina.circle(101, steps=50)
tina.end_fill()

turtle.exitonclick() # Close the window when we click on it
Expand Down
16 changes: 13 additions & 3 deletions lessons/00_Turtles/03_Check_In_Your_Code.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,22 @@
"Github codespace will be stopped automatically, then deleted after a few weeks,\n",
"and you will lose your changes. So check your code in!\n",
"\n",
"On the left side of the Codespace window, look for this icon. The number may be\n",
"different for you ( it will probably be 1). \n",
"## Make a Change\n",
"\n",
"Let's make a change to `02_Meet_Tina` so we have something to checking. You can\n",
"change anything you want! Maybe make the circle a diffferent size \n",
"( change `tina.circle(100, steps=50)` ) or change what tina says ( change\n",
"`tina.write(\"Why, hello there!\")` ) or anything else, then save your file. \n",
"\n",
"## Commit and sync your code\n",
"\n",
"Once you have made the change, save your file. Then, on the left side of the\n",
"Codespace window, look for this icon. The number may be different for you ( it\n",
"will probably be 1). \n",
"\n",
"<center><img src=\"https://images.jointheleague.org/vscode/git_changes.png\" width=\"100px\"></center>\n",
"\n",
"This is the Git icon; click on it to get accecss to the Source Control tool for\n",
"This is the Source Control icon; click on it to get accecss to the Source Control tool for\n",
"checking in your code. Now the Source Control pane should look like this: \n",
"\n",
"<center><img src=\"https://images.jointheleague.org/vscode/sc_changes.png\" width=\"400px\"></center>\n",
Expand Down
3 changes: 3 additions & 0 deletions lessons/00_Turtles/04c_Turtle_Tricks.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@
... # Your code here

turtle.exitonclick() # Close the window when we click on it


# Dont forget to check in your code!
26 changes: 24 additions & 2 deletions lessons/00_Turtles/06_Variables_and_Functions.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,17 @@
"source": [
"# Variables and Functions\n",
"\n",
"<div class=\"alert alert-info\">\n",
" A few thigns to remember:\n",
"\n",
" 1) Commit your code! Review `03_Check_In_You_Code` for a reminder \n",
" on how to commit and sync your changes. \n",
" 2) Remember that these `.ipynb` files have runable cells. Review `01_Get_Started`, \n",
" in the section \"Running Programs\" for a reminder on how to run code cells in this file. \n",
" \n",
"</div>\n",
"\n",
"\n",
"Here is one of the ways to solve the last assignment, making shapes with a\n",
"loop:\n",
"\n",
Expand Down Expand Up @@ -33,9 +44,20 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 1,
"metadata": {},
"outputs": [],
"outputs": [
{
"data": {
"text/plain": [
"60.0"
]
},
"execution_count": 1,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Run me\n",
"# Compute the angle for a number of sides\n",
Expand Down

0 comments on commit 3d6d701

Please sign in to comment.