Monday, 12 December 2011

This semester as a whole

I came into this class with a very basic knowledge of java and for the most part this hasn't changed. I can tell that there is still much to learn, though I definitely making progress. There are still things that I know java is capable of, I just don't know how to do, though I am slowly learning these things on a case by case basis. Just last weekend I began to teach myself how to read in the frequency of a sound file into java. In addition to file IO java.awt is full of things I do not understand. When I import third party classes I do not understand. For one, bitwise functions confused me for ages before now. The content we have been learning is mostly things that, although I have not wondered about in the past, I am going to use in the future.

Gridworld is an entirely different subject. To be perfectly honest, gridworld is insanely stupid. As far as I can tell it is meant to teach about different types of methods, though one requires a knowledge of methods in order to make programs in gridworld.

On my own I have been finding more and more how the math I have been learning applies to programming, trigonometry and vectors are proving to be ridiculously useful. I find that I have the most fun with projects oriented towards applications of math and less so projects that actually have practical use, which results in me having very convoluted and off topic labs.

The labs in Comp Sci definitely accomplish what they need to and teach one something about the application of the material we are learning. They are very clearly well put together and their bizarre nature only adds to them. The worksheets do what they are supposed to and always cover the material fully, in-case I miss something in the presentations.

Overall I am very satisfied with this class and, although it could go faster, I see no reason for it to as long as we wholly cover the material.

Sunday, 4 December 2011

String cutting and bitwise




At first I was very confused as to the applications of bitwise functions though it makes sense when one considers how little processing power it takes to execute the functions. It's not immediately useful though I want to take on some sort of project but only use a very small amount of memory, mostly to get in the habit of writing efficient code. Using scanner with Strings instead of System.in was pretty straightforward, I don't see a lot to comment on there.
On my own I made a JAR that runs a polar cosine equation using circle every 10 degrees or so. This ends up with a series of circles orbiting a point in interesting patterns. This project isn't very impressive in itself though it was fun to find the designs it could generate if I didn't clear the canvas after drawing.

Saturday, 26 November 2011

Late post

Last week the class worked with gridworld. Personally I find gridworld to be unnecessary, though I can see why one would need to have prior knowledge of it for the AP exam. The bugs were straightforward and, to avoid having to actually code the infamous ZBug correctly, I hard coded it with move() and setDirection(). The rest of the bugs were relatively straightforward. On my own time I have been working on a series of grid based generators for whatever reason. The first one made a series of randomly generating rooms, the second was randomly done but with a tendency towards certain areas to give the impression of a randomized gradient off of a point or line. I made a few other generators of this sort though I'm not entirely sure what I'm going to do with them. In general I'm fine with where the class is going, we pretty much just surpassed my prior knowledge with the introduction to inheritance through gridworld.

Sunday, 13 November 2011

Tests and such

We took a test last week. The biggest problem I had on the test was a question containing an unknown part <*1>. It wasn't clear to me that this represented an unknown variable, as this was not clarified in the question. I feel that I could have figured it out had I known this. Otherwise the test was fairly straightforward. I spent a lot of time on nested for loops though I got most of them right so I feel fine about that. I really liked the free response question as it wasn't a straightforward question and it actually tested that you knew how to use the code effectively rather than just the syntax.

Sunday, 6 November 2011

Finishing labs, quiz...

Not a lot happened in class, this was a double A day week and most of the time was spent finishing labs and such.
Daniel has been working on a 3D engine of sorts, using equations and ray tracing to make shapes in pseudo 3D. It seemed like an interesting project, and I wanted to try my hand at it myself, so this weekend I did. I'm not entirely sure how his works and this was partially intentional as I wanted to compare our separate approaches. My program currently does not work, which is not surprising considering the little time I have put into it. It compares parametric equations of a sphere and a 3D line to find if they intercept with the line intersecting certain points. In order to find if they intercept it checks parts of an equation in sqrts to find they come out negative, indicating a nonreal point of intersection and thus no intersection to graph. The code is actually very short, only a few hundred lines, most of which are for variable creation.

Sunday, 30 October 2011

Booleans

I already knew about booleans and didn't learn much. I did, however, get a lot of enjoyment out of a separate project during class involving pseudo-gravity in two dimensions. This weekend I rewrote the program and made a console for it. That is, I wrote a small text editor and had it separate the first word and any numbers after it. Using this, I made a series of commands to change things such as the number of bodies in this pseudo-gravity, their range of size, their pull, etc. It's very fun to mess around with though it's very finicky and I'm having a weird problem with the text flickering. In order to change a string to an integer/double I used toCharArray and converted the characters from there. It's very easy to add a command and overall I'm happy with out flexible this project ended up being.

Sunday, 23 October 2011

This, I know

For loops and while loops are both entirely review except for the for the length loop. Not much else to say, really. I realized that you can't do string.replaceAll for a blank space, you have to use for and substring...
A friend of mine might teach me some C, which would be fun 'cause I can't see doing realtime 3d in something as slow as java, which is a project I've been working on. Not sure if I've already said this, but I'd like a class that teaches how to code rather than how to use a language. I.e. teaching about various concepts in programming and how to do things like 3d and perlin noise rather than teaching syntax. I might end up learning this in later math class instead, though.