Introduction to

Programming

A program...

  • is a set of instructions

  • perform tasks

  • executed by a computer

  • is like a recipe

  • is read from left to right, top to bottom

Pseudo code

An informal high-level description of the operating principle of a computer program or other algorithm. It uses the structural conventions of a programming language, but is intended for human reading rather than machine reading.

 

i.e.

Simpler code for humans to read

Example

target_score = 1000

repeat forever,

 current_score = get_current_score

 if target_score > current_score,

    continue_level

 if target_score <= current_score,

     move_to_next_level

Tech Terms

target_score = 1000

repeat forever,

 current_score = get_current_score

 if target_score > current_score,

    continue_level

 if target_score <= current_score,

     move_to_next_level

Variables

Loop

Condition

Function

Simplify Example

target_score = 1000

repeat forever,

 current_score = get_current_score

 if target_score <= current_score,

     move_to_next_level

 else
    
    continue_level

Simplify Even More


target_score = 1000

repeat forever,

 current_score = get_current_score

 if target_score <= current_score,

     move_to_next_level

Let's do this together

* odd
* even
* get dice value
* loop through rolling


* 

Now you try!

  • Groups of 3-4
  • Write pseudo code
  • Game of Rock Paper Scissors
  • Write each line on a post it note
  • Form a program

 

Javascript

  • client side
  • interpreted by the browser