Permalink
Browse files

changes to layout, added one more exercise

  • Loading branch information...
teikmeout committed Sep 29, 2017
1 parent ffe25fb commit 67133910169ce84cf0bc13613b19c7aff59f4a79
Showing with 24 additions and 20 deletions.
  1. +24 −20 README.md
@@ -15,6 +15,8 @@ competencies: Programming
- [ ] Understand what pseudo-code is and it's usage
- [ ] Learn how to map out a flow-chart

## Lesson pre-requisites

## What is Pseudo Code?
Pseudo: _not genuine; sham._
Code: byproduct of a developer drinking bad coffee while poorly sleeping 👻
@@ -23,8 +25,8 @@ _a notation resembling a simplified programming language, used in program design

## What do we use pseudocode for?
Pseudocode helps us break down the complexity of a problem before coding it.
Sometimes we might feel the burn of running into a problem and wanting to solve it immediately on code, but the time we invest designing how our algorythm should work is time that we will not spend stuck trying to write something that works.
> It is languange agnostic: needs no specific syntax elements of the programming language.
Sometimes we might feel the burn of running into a problem and wanting to solve it immediately on code, but the time we invest designing how our algorithm should work is time that we will not spend stuck trying to write something that works.
> It is language agnostic: needs no specific syntax elements of the programming language.
### Real life Example of pseudocode: Clean a car!
```
@@ -50,13 +52,13 @@ Tasks:
- [ ] Dry car
```

This process can go on until we reach a basiv level action that we can understand.
This process can go on until we reach a basic level action that we can understand.

## - We Do - Pseudocode me a PB&J Sandwich!
![pb](https://media0.giphy.com/media/120P4ZQY2jT8DS/giphy.gif)
Team up with the people on your table!

- What actions do I have to complete in order to eat this delicous PB&J Sandwich?
- What actions do I have to complete in order to eat this delicious PB&J Sandwich?
<details>
<summary><strong>Click HERE to uncover some possible answers </strong></summary>
1. Make a sandwich
@@ -92,14 +94,14 @@ Break it down into smaller steps until they are individual actions!!
</details>

## Pseudocode Principles
There are none. The concept is to make a hybrid language between code and english (or the language you speak) to process the logic of your problem without the abstraction of code.
There are none. The concept is to make a hybrid language between code and English (or the language you speak) to process the logic of your problem without the abstraction of code.

We can use some of these following principles just to follow some general consensus:
1. One statement per line (representing one action for the computer)
2. Capitalize initial keyword
3. READ (take an input), WRITE (print, consolelog), IF, ELSE, ENDIF (closure of IF), WHILE, ENDWHILE, REPEAT (do), UNTIL (while).
4. Indent to show heirarchy (is this a sub-process of someone else?)
5. END for multiline structures
4. Indent to show hierarchy (is this a sub-process of someone else?)
5. END for multi line structures
6. Make statements Language independent (someone who doesn't code should be able to read)
7. Same Operators, Arithmetic, AND (`&&`), OR (`||`),

@@ -133,7 +135,8 @@ ENDIF
Break up into teams of two:
Write the pseudocode for the following:
- [ ] Reverse a string (think of the string as an array)
- [ ] Change all the vocals in a word to an `*`
- [ ] Change all the vowels in a word to an `*`
- [ ] Fizz Buzz

## Flow-charts
_a diagram of the sequence of movements or actions of people or things involved in a complex system or activity._
@@ -142,16 +145,17 @@ _a diagram of the sequence of movements or actions of people or things involved
![](https://i.imgur.com/tw8WPez.png)

**If Statements:**
![if](https://i.imgur.com/3SE63V1.png)
![if](https://i.imgur.com/3SE63V1.png)

**Loops:**
![loops](https://i.imgur.com/onhNT5v.png)
![loops](https://i.imgur.com/onhNT5v.png)

### Flow chart Symbols
![symbols](https://wcs.smartdraw.com/flowchart/img/basic-symbols.jpg?bn=1510011094)
### Flow chart Symbols
![symbols](https://wcs.smartdraw.com/flowchart/img/basic-symbols.jpg?bn=1510011094)

## - You Do - (15 mins)
Convert your previous white-boarding to a flow-chart!
## - You Do - (20 mins)
Convert your previous white-boarding to a flow-chart!
![panda](https://media.giphy.com/media/rCc9f6aCMhHl6/giphy.gif)

### Advantages of Pseudocode vs Flow-charts
Pseudocode Disadvantages
@@ -170,14 +174,14 @@ Flowchart Disadvantages

Flowchart Advantages
- Standardized: all pretty much agree on the symbols and their meaning
- Visual (but this does bring some limitations)
- Visual (but this does bring some limitations)

## Some extra coding problems to solve:
- Capitalize every first letter of input (consider something like `prompt()` capturing the user input).
- Obtain the average of all the values of an array.
## Some extra coding problems to solve:
- Capitalize every first letter of input (consider something like `prompt()` capturing the user input).
- Obtain the average of all the values of an array.

### Resources:
Free flow chart online App [Lucidchart](www.lucidchart.com)
More [whiteboarding](https://git.generalassemb.ly/wdi-nyc-algorithms/whiteboarding-meetup/blob/master/algorithms.md)
Free flow chart online App [Lucidchart](www.lucidchart.com)
More [whiteboarding](https://git.generalassemb.ly/wdi-nyc-algorithms/whiteboarding-meetup/blob/master/algorithms.md)


0 comments on commit 6713391

Please sign in to comment.