# Welcome!

## **Welcome to the Python Summer Coding Camp!**

My name is Mr Cheng and I'll be your instructor! &#x20;

The Department of the Navy Naval Air Warfare Center Aircraft Division Lakehurst has generously funded computer programming camps in Python and Unity Game Design. Camps will run Monday through Thursday July 26-August 5, 8am-noon. The application can be found here: [www.tinyurl.com/TRSummerCode](https://docs.google.com/forms/d/14R35a-ePqlcLb9PnQo4mEkGgPWX0jhFx6OrE0iC6rkg/viewform?edit_requested=true)

![](/files/-MfXH-OKKuiledlidoEv)


# Activity

## Presentation

{% embed url="<https://docs.google.com/presentation/d/1NbkZ78sMNCwtb9YlCAOBsZcaO2Vx7Sss9sbmk4bsPPo/edit?usp=sharing>" %}

## Python Turtle Interactive Mode

{% embed url="<https://youtu.be/Vs-fxZ0tn4Y>" %}

## Python Turtle Script Mode

{% embed url="<https://youtu.be/Rr_1cPWgE_M>" %}

## Turtle Commands

| Command                         | Description                                                                                                                                                                                                                                                                                |
| ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| turtle.forward(*distance*)      | Move the turtle forward by the specified *distance*, in the direction the turtle is headed.                                                                                                                                                                                                |
| turtle.backward(*distance*)     | Move the turtle backward by *distance*, opposite to the direction the turtle is headed.                                                                                                                                                                                                    |
| turtle.home()                   | Move turtle to the origin – coordinates (0,0) – and set its heading to its start-orientation.                                                                                                                                                                                              |
| turtle.penup()                  | Pull the pen up – no drawing when moving.                                                                                                                                                                                                                                                  |
| turtle.pendown()                | Pull the pen down – drawing when moving.                                                                                                                                                                                                                                                   |
| turtle.pencolor(*colorstring*)  | <p>Set pencolor to colorstring (default colorstring is "black")  </p><p></p><p>Examples:</p><p></p><p>turtle.pencolor("red")</p><p>turtle.pencolor("blue")</p><p>turtle.pencolor("yellow")</p><p>turtle.pencolor("blue")</p><p>turtle.pencolor("black")</p><p>turtle.pencolor("green")</p> |
| turtle.circle(*radius)*         | Draw a circle with given *radius*.                                                                                                                                                                                                                                                         |
| turtle.circle(radius, extent)   | Draw a circle with given radius and extent – an angle – determines which part of the circle is drawn.                                                                                                                                                                                      |
| turtle.shape("turtle")          | Sets the turtle shape to turtle.                                                                                                                                                                                                                                                           |
| turtle.undo()                   | Undo (repeatedly) the last turtle action(s)                                                                                                                                                                                                                                                |
| turtle.clear()                  | Erases all drawings that currently appear in the graphics window.                                                                                                                                                                                                                          |
| turtle.begin\_fill()            | Starts the fill color                                                                                                                                                                                                                                                                      |
| turtle.fillcolor(*colorstring*) | <p>Examples:<br></p><p>turtle.fillcolor("red")</p><p>turtle.fillcolor("blue")</p><p>turtle.fillcolor("yellow")</p><p>turtle.fillcolor("blue")</p><p>turtle.fillcolor("black")turtle.fillcolor("green")</p>                                                                                 |
| turtle.end\_fill()              | Ends the fill color                                                                                                                                                                                                                                                                        |


# Activity

## Presentation

{% embed url="<https://docs.google.com/presentation/d/1R787UZytlaCXWqfh4-bs5YwxKbc-O8B_A7BViIr2X1k/edit?usp=sharing>" %}


# Activity

## Presentation

{% embed url="<https://docs.google.com/presentation/d/1RFvwj6_DSsx_eOS9M-RM3yXqhZJmUaZDUY22Sh-YsvA/edit?usp=sharing>" %}


# Activity

## Presentation

{% embed url="<https://docs.google.com/presentation/d/1DsffAa22jKx-jFrsJFe07J8iJ3HBqfEWQiVYv_4ZjzA/edit?usp=sharing>" %}


# Activity

{% embed url="<https://docs.google.com/presentation/d/1-jriurWRaJJxVNNeSZVw5BLxnvck9avHeLHG7Oh_lwo/edit?usp=sharing>" %}


# Activity

{% embed url="<https://docs.google.com/presentation/d/1cXNI7elyhAYY9Zk09WTYZNs5c6oJVymtgSpKfPTcgrs/edit?usp=sharing>" %}


# Activity

{% embed url="<https://docs.google.com/presentation/d/1PG0ck2_wcd7H-ZP5LXpvYXsc1T93nF3U2SreJcPz7mo/edit?usp=sharing>" %}

## Adventure Game Starter Code

```python
# Story Game
# by me

def main():
    print("Welcome to my game!")
    print("By ...")
    done = False
    while not done:
        print("S - Start")
        print("Q - Quit")
        choice = input(":: ")
        if choice == "S":
            intro()
        elif choice == "Q":
            print("Thanks for playing!")
            done = True
        else:
            print("Invalid Choice")

def intro():
    print("Story Game")
    print("by me")
    print("You want to play a game with your friends")
    print("Which do you choose? Roblox or Minecraft")
    choice = input(":: ")
    if choice == "Roblox":
        roblox()
    elif choice == "Minecraft":
        minecraft()
    else:
        print("Invalid Choice")

def roblox():
    print("You decide to play Roblox!")
    # add story and choices

def minecraft():
    print("You decide to play Minecraft!")
    # add story and choices

main()
```


# Activity

{% embed url="<https://docs.google.com/presentation/d/1ys30iIKH5cBTWX1Z1NVSKNocYN3ifUzm_6BqT6QTtRM/edit?usp=sharing>" %}

u


