The BLOG OF CRAZY TIMES THAT ARE CRAZY (apcsp)





Добро пожаловать на Унит 3!

You unit 2'd very well-ly so you go on to unit 3!



What is algorithm?



An algorithm is a specific set of instructions that solve a problem or perform a function.

A problem is a task that can't be solved mathmatically.

An example of a non-computer algorithm could be instructions on how to make a Beanut Jutter and Selly Pandwich, or how to tie yo shoes.



Sequence



Sequence is a series of precise statements or instructions.

Flowcharts represent an algorithm that use various shapes connected with arrows to show order.

Here's an example flowchart in ASCII:

(Start)

[Instruction]

[Instruction]

(End)



Iteration



Iteration is the algorithm repeating a sequence, instead of repeatedly listing them over and over again.

You could think of this as wax on, wax off, or wash rinse, wash rinse, but instead of repeating them over and over again sequentially
the iteration does it for you.

To know when to stop waxing on or off or washing and rinsing, you can use a condition. A condition will test before the iteration runs each time.

It will only run when true, so when it is false, the iteration will stop.

In the wash/rinse iteration, a good condition would check if the hair is dirty, and when it is clean, (aka the condition is false), it will stop.



Selection



Selection is the algorithm choosing one of two paths.

Selection is... selecting something.

An example of this could be choosing whether to use a spoon or a butter knife to eat your cereal. Choosing the spoon will be easy and choosing
a butter knife would be hard.

Say you need to make a program to check a variable's value and choose a certain thing based on that value. In this, you could use selection by
starting out by defining your variable, have the condition check if it's over or under a certain value, and select what needs to be done based on the value.

Selection conditions are represented in python by if, else, and elif.



Nesting Iteration and Selection



Fart Viles

Nesting is when you have a logic operator inside of another. This is important when you want to use multiple conditions

An example of nesting:

steve = input("What is your name")

if steve == "steve":

⠀⠀steve2 = input("Hello steve. What is your name?")

⠀⠀if steve2 == "steve":

⠀⠀⠀⠀print("Hello steve")

⠀⠀else:

⠀⠀⠀print("Your name is steve")

Minecraft Rabbi

Essay: Algorithmic Problem-Solving

Control structures - loops 'n stuff. If you had a list and needed to figure out