Programming

Logo

Here's what I learned to do today in Logo:

Loops

Loops are very useful if you have to do something over and over.

Variables

I used variables when I wanted to change the value of a number like "sidelength".

Conditionals

Conditionals are "IF" statements. I used them when I wanted a ball to bounce if it hit the edge of the screen.

Functions

Functions organize your code, like this star function:

Then I made a spiral function that used the star function:

Here's a fractal I made using recursion:

Math Functions

On Thursday I learned to put my math functions into Logo:

In the Command Center I made the computer crunch the numbers:

Python

On Wednesday of week 2 we finally got to program in Python! We were doing stuff with binary numbers so we wrote a Python program to convert binary numbers to decimals (we didn't finish the decimal to binary converter). Here's the code:



It took a lot of coding and I got a lot of errors, but it finally converted some really big numbers from binary to decimal:



Numerical Integration

Today we used Python to find the area under a function by splitting it up into rectangles. Here's the code: