Thursday, July 26, 2012

DSDN 142: First Experiences With Actual Coding

So I've finally taken time to blog about my first experiences with coding!

I've found it really refreshing and a lot of fun. The way the whole thing essentially revolves around numbers and logic is great, and to tell the truth, a real breath of fresh air into my degree. My brain figuratively jumped at the chance to exert itself again.

At first it took me a while to get my head around the syntax, (and I still occasionally forget to add the semicolons at the end of each line!) but once there, I got it. I had a eureka! moment and then it was all clear. Thank goodness. Not sure how I'd be doing if I hadn't grasped it quickly...

So I started off the lesson learning to first create a basic series of lines and shapes that the tutor gave us. T'was fun!



Then, once I had done that, I got thoroughly stuck into making my shape. I started off with a canvas of 300x500 pixels, since my shape wasn't very high, just wide.


Then, next, I created what I deemed were the starting points for my shape, namely the exterior x-shapes that touch the edges of the infinity sign. I worked with easy 50-pixel heights and widths so as to make my life easier.



Then I went on and did the second series of lines, making sure that the starting points were the same as the ending points for the last set.


The next step was to draw the central x, which was going to form the basis for the infinity symbol. Again, this was all still pretty consistent with a 50-pixel grid of sorts.


The final step was by far the hardest. I had to figure out the radius of the circle using the square root function and certain multiples of 50. And I still got it wrong multiple times before I got it right.


But there we have it! That's my baseline shape from which all the alterations of it are going to stem. My code still left a lot to be desired after this session, so I set out to clean up my code and use less variables.

No comments:

Post a Comment