<--Back to Home
<-- Previous Page (Servers)
Next Page (Circuits)-->

The Programming Project

Click the picture next to the name of a program to learn more about them!

NetLogo

NetLogo is a computer programming language that can make various shapes and sizes. Logo uses turtle models and command box to carry out scripts.



A triangle is one of the simplest figures you can make in Logo. Here's the script:



Pretty short isn't it? Scripting just simplifies the amount of words you use to make a function.

'To triangle' really means "program a triangle".
'Pd' means "pen-down", which actually refers to the turtle. Using 'pd' in a script will allow the turtle to leave a trail when it moves.
'Repeat' kind of explains itself. It makes the following words repeat [insert number here] amount of times. Repeats start with an opening bracket and ends with a closing bracket.
'Fd' means "forward". For example, if you type 'fd 10', the turtle will move 10 steps forward.
'Rt' refers to the angle the turtle's pointing at. If you type 'rt 180', the turtle will turn in the opposite direction.
This pretty much explains the triangle script. Though there are many more scripts on this page, I will only be explaining a few...



This is a polygon I made with loops and turtles. Here's the script:



'Repeat numberofsides' represents how many times the following action should be repeated, which corresponds to the number of sides the object has.
Last of all, since a polygon is a 360 degree figure, you divide 360 by the number of sides the object has.



A circle is a 360 degree closed figure. Here's the script:



This just says for every 10 rt (angle) turned, move 1 step forward for 37 times.



This is a unique flower I made. Though it's suppose to be 12 petals, I decided to challenge myself and let the script be more complicated The script for this is stated below:



Since this script is quite long, I won't be explaining it, but there are some content in this script that is similar to the polygon's.
The second to last line, die, simply means die! For the turtle, that is.





In this picture, conditionals are present. Conditionals are words that say what state the script is in (Ex. True/False).
I made a program that shows whether or not a number can be divisible by 3 WITHOUT a remainder.



The script above is used to find out whether or not a number can be divided by 3 with no remainder.
If the number CAN be divided by 3 (true), a text will say, "divisible by 3".
If the number CAN'T be divided by 3 (false), a text will say, "not divisible by 3".



While I was using trial-and-error to make a twelve petal flower, I came up with the picture above. I thought it looked interesting, so I decided to add it.



The script for the circular-thing is pictured above.

Python


During our 4th week, we started to learn about coding in Python to control an NXT Pybot. Python is a bit more complicated than Net Logo.
To see some coding in Python, visit the Robotics Page (scroll down to the coding section).

Visual Python


For our 5th week, we learned how to code using VPython. It's exactly like Python, except this time we generate 3D images and animations instead of commands.
To see some coding in Visual Python, visit the 3D Graphics Page (scroll down to Visual Python).

Alice


During our 5th week, we also learned how to generate 3D images using Alice. Alice is useful to create stories, games, and animation!
To see some coding in Alice, visit the 3D Graphics Page (scroll down to Alice). Also, this page is a great site for Alice tutorials.

Scratch


During my 6th week, I worked on some games on Scratch. Since I was absent for weeks 2 and 3, I figured I had to catch up eventually.
To see some coding in Scratch, visit the Game Programming Page.
Next Page (Circuits)-->
<-- Previous Page (Servers)
_______________________________________________________________________________________________________________________________________

















Last updated on May 28th, 2014
@1:14 P.M (PST)