Programming

In class on September 19, 2013 we learned about programming. We learned how to use NetLogo. We were able to make the computer tell us if a number was prime or not. We were also able to make the program tell us if a number was even or odd. Both of these task are a lot easier said then done. Although both task were very hard it was really fun to figure out and put our skills to the test.

The picture above shows a code strip is taken out of NetLogo. This code will make NetLogo tell you if the number you put in is a multiple of three. This is very fun to play with and is great to watch work.

In the picture above you see some more code. This a code that is also from NetLogo.This code will write out 1- any number so if wrote in ten the application will pop up with, 1,2,3,4,5,6,7,8,9,10. This is fun because you can watch the computer count up to 1000.

The command above will make the turtle on screen make a square to your size choice. You can pick the size using a slider.

The coding above is the second hardest I had to do. This makes your turtle create a flower with a peddle on the root. The end product looks like the picture below.





The two pictures above are the same code. This is my hardest code. This spawns 100 turtles and has them eat the grass that spawned with them. This is hard because the grass also regrows after not being ate or stepped so the code is very confusing. But it was fun to figure out and watch the final product.





JavaScript

Today I learned more about JavaScript. I created the following code.



This code creates the following image. This was not a project in class just something I wanted to make.




s