About Me

Ontario, Canada
In regards to this blog, I am simply trying to learn to program in my free hours after work in order to make an iPhone game.

Thursday, April 30, 2009

C for Dummies: Chapter 16

Alright, for my first official post (apart from my droll mission statement) I will simply tell you about my current experience and where I am at in my studies.

To learn the C language I am using the C for Dummies book which you can probably find at your local book store or buy online straight from the Dummies Store.

Currently I have just finished chapter 16 where the book discusses the for() loops in a bit more detail, and explained some mathematical shortcuts that programmers are able to take.

For instance, 5x5x5x5x5. . .etc is equivalent to z*=5 (where 'z' is the variable and * is the multiply symbol).

Example:


for(z=5 ; z>=500 ; z*=5)
{
statement;
}


That simply says to start the 'z' variable at 5 [ z=5; ], keep running the loop until the 'z' variable is greater than, or equal to 500 [ z>=500; ], achieve this by continuously multiplying the 'z' variable by 5 [ z*=5 ].

Right now I am unsure of where I would want to use this type of loop, but I am sure as I start to learn more the answers will become clear to me :)

Cheers!

Wednesday, April 29, 2009

Mission Statement!

This first post of the Tom-Jar blog is to state my mission.

Mission is as follows.

#include

int main()
{
int hope;

printf("Learn a few programming languages\n");
printf("Learn to apply that programming knowledge toward iPhone game creation\n");
printf("%d you are not too late to the party\n",hope);

if(hope==true)
{
printf("Make a lot of money\n");
}
else
{
printf("Get a real job!\n");
}

printf("%d that was informative for you!\n",hope);
return(0);
}



Now obviously there are a few errors in this source code, but I think the message comes across pretty clear no? :P