Thursday, June 25, 2015

Day Three: Flowcharts & Word Lists

Once we had two days of coding behind us, students began work on a difficult program: Hangman.

We played "old school" Hangman first, then analyzed the process and wrote a flowchart.


It looks like a butterfly! :-)

Once students understood what the program had to do, we started writing code...

But first, we learned how to create ASCII pictures. Students were challenged to make a picture of a frog using only the letters, numbers, and characters on their keyboards.

ASCII frog completed!

DAY THREE CONCEPTS:
  • while loops: execute code as long as a certain condition is met
  • if loops: execute code once if a certain condition is met
  • else: executes code if the "if" condition is not met
  • break: breaks a loop
  • length (len): counts the length of an item (word, series of number)

Day Two: I'm thinking of a number...

For day two, students continued writing short programs.

Because we had one Raspberry Pi for every four students, we used a concept called Paired Programming.




First, students worked with variables, setting the value of the words "spam," "bacon," and "eggs." We learned that any words can have values set to them.

Students worked in their groups to write a program that would ask for the user's name, greet them, and let them play a "guess the number" game.

DAY TWO CONCEPTS:
  • variables: words that can vary -- the meaning can be set by the programmer
  • integers (int): whole number value
  • #: (we called this a sharp instead of a hashtag) this lets the programmer write notes about the program -- it lets the computer know that what follows is not code

Monday, June 22, 2015

Code Camp: Day One





First we assembled the Raspberry Pi then we programmed Jokes!


For the advanced code camp this year, students worked in groups of 3 or 4 and coded programs using the language Python on Raspberry Pi computers.

The Raspberry Pi is a small computer designed for use by coders, engineers, and people interested in learning how to program.

The Raspberry Pi B

Students learned to:

  • connect the Pi to a monitor, keyboard, power source, and mouse.
  • open and use the Python shell program
  • write code that would print a brief message (Hello World!)
  • write a module that would show the beginning of a joke, wait for user input (Enter), and show the punch line of a joke


DAY ONE CONCEPTS:
  • Hardware:
    • monitor (visuals)
    • keyboard & mouse (input)
    • Raspberry Pi (processing unit)
  •  Software:
    • NOOB (new out of box) -- the basic programs used by the Raspberry Pi
    • Python Shell -- a program that allows you to write and run modules
  • Coding:
    • strings (str): text or words
    • print (print): writes whatever is inside parentheses and apostrophes
    • input (input): accesses what the user types
    • string concatenation: linking strings (+)
    • extensions: .py (python file), .doc (document file), etc.