Advanced Programming - The C Family of Languages


Java Processing

During the final week of expeditions, we went began it all by going over the C Family of programming languages. We started with the Java Processing, a language of visual Java. We first started making shapes by setting coordinates and the size of the shape along with what shape we wanted. It was pretty simple to do, just put the command for that shape along with filling out the paranthesis with numbers for the different settings. After that we learned how to change colors using "fill", which colored the shapes based on the rgb values. Something that was different from other programmings done in the past this year was that we needed many semicolons and brackets, although I was used to this because I've done C++. We also saw that to set up a function you used voids. Doing this was a lot different from Python but had a familiar feel, both because I've done C++ and also because programming languages all have the same basic feel. Below will be a picture of my tests with shapes.

After we finished with the shape testing, we decided to make the illusion of the shape moving. To do this, we used the voids we learned earlier and put variables that the center of the shapes were set to. After that, we had a loop that changed these variables and redrew the shapes. Because of the fact that the shapes would go in a straight line and end up going off screen, we main conditionals that changed whether the variables were going up or down in value based on what the value of the variables were. This made the object seem to bounce off the wall. This was good and all, but the thing still left a trail of old drawings. To fix this, we had the system cover up the old shapes with the background every time it went through at the beginning so that it would look like there was one shape that was moving. After that we tested around with changing the color along variables like how the movement did. We also turned off the system that covers up the old shapes for artistic values. Below is another picture of my work.

I would love to include a giff of it moving, but I don't know how to. Also, the background is some of my work. Also, bellow is the programming I made.

Java Script

On the second day of the last week, we went over more C Family languages with Java Script. We went on the site codecademy and learned some Java Script. While looking into it I learned how to make pop up questions, do conditionals, right things out, set variables to the user input, and make functions. I also learned how to get the length of strings and how to make substrings. After looking into Java Script I decided I should go over and review my C++. After a lot of fumbling around trying to remember how to get things to work, due to the fact that I couldn't reference my old work and I haven't done C++ in a while, I gave up and just wrote things on this html. When I'm more confident in my Java Script, I may try putting a little programming into this web page. Below is the button that I want to lead into a text based adventure game...

Back to Java Processing

On the third day of the last week, we went back to Java Processing. With the knowledge we had from the first day on the subject, we began by creating a house out of shapes. After creating said house, we set it in a function with the position of the house set to a function. Using proportions, we set the size of the house to a variable as well. After that we were able to create a house at any location in any size we felt like. Below is a picture of the house I created. Please keep in mind that it has a door knob.

After creating the interchangeable house, we went over and made it so that we could create the house multiple times in different places. To do this, we set the function on a loop and had the variable for the x position change each time it went through so that it would create multiple houses in a row. Below is a picture of said houses. Remember, they have door knobs.

In this work, I was most proud of making the door knob because the door knob was a bit complicated to set the proportions for. Below is a picture of the code I wrote for this. I am proud of my work.

After finishing that in the house, we went over wave patterns caused by using sine in a function. With that, we were able to make objects that moved in a wave pattern. We then put this knowledge into our houses and made the houses create a wave. Below is my work on the wavey houses.

Shortly following the completion of my house wave I created a double helix version of the house wave. In motion, the house waves look really cool and confusing. Remember, my house has a door knob. Below is a picture of my double helix house wave.