Tuesday, 14 January 2014

Khan Academy - Simple Animation

Pig - Animated

Made using: Khan Academy Computer Science.

My pig drawing is now animated, the pig grows in size til it fills the screen. This was achieved by using the draw function and an if statement, so whilst the face size is less than 300 pixel the pig will grow on the screen once it reaches 300 pixels it stops.

Khan Academy - Variable Expressions

resizable pig

Made using: Khan Academy Computer Science.

My pig drawing is now resizable! Tweaking the faceSize variable value resizes the drawing keeping everything in proportion so it scales rather than distorts. This was achieved by using variable expressions and fractions. Each variable is related to faceSize and parsed into each function call to allow this to happen.

Khan Academy - Javascript

Pig

Made using: Khan Academy Computer Science.

I'm finding that transferring skills between languages is so far quite simple, this evening I have spent a few hours reading up on and watching videos about Javascript on Khan Academy. This task was a lot of fun, it only involved very basic shape placement and a tiny amount of variables but I have learnt quite a bit.

Monday, 6 January 2014

Grok Learning - Hour of Code - The Dark Tunnel

Grok Learning's third and final contribution to the hour of code project involved making a small text based game using user input, variables, if statements and loops. The biggest lesson I have learnt from this is to always test as you go along, I first wrote out a lot of code, it did not work quite right and I could not find my error so had to start afresh, this time I made a point of checking each command to make sure it did what I wanted it too then fleshed it out further to incorporate the next task. This seemed to work well and my code passed testing, however I am not 100% sure my code is as concise and clean as it could be so am setting myself the extra task of refining the code til I am certain it is the best it can be.


Grok Learning - Hour of Code - Disease Epidemic!

Just completed Grok Learning's second contribution to the Hour of Code project, it was very similar to the first; revisiting if statements and loops etc but this time using integers and comparison calculations instead of working with strings. Now feel more confident working with if statements and user input in Python, was able to write the code needed naturally rather than keep re-reading the study text to find the answers. On to the third and final version.


Sunday, 5 January 2014

Grok Learning - Hour of Code - Is Eliza Human?

Just finished Grok Learning's first contribution to the Hour of Code project. This involved using Python to create a basic chat bot. The chat bot reacts in different ways to predefined statements, if you mention a film the chat bot knows it will give you a personalised answer, if you mention one it doesn't it returns a generic answer. Creating a believable chat bot would be very complex but this was a fun introduction to variables, if statements, while loops and user input.


Saturday, 4 January 2014

New Year

It is my goal for 2014 to try and study programming for at least one hour per day. I currently have some basic knowledge. Today I completed the Code.org Hour of Code course which was designed for Computer Science Education week back in December. The short course teaches the basics of programming including loops and if statements and it does so in a very fun way which helps it stick in the mind. If you make mistakes the animations show you why and if it works correctly you feel a sense of accomplishment when your character reaches its target.



I would definitely recommend this course to anyone wanted to test the water and see if they enjoy computer science.