Wednesday, March 26, 2014

Weekly Reflection #8

Just as I'd said last week, this week I actually don't have anything to blog about. Chapter 8 stressed the importance of using flow charts to plan out your game. Hangman was used as an example because hangman, although very simple, it is very complex when learning to program the game.

Although part of me feels like this was a waste of a chapter(like I could have googled being more efficient with programming), I do also feel it will be very beneficial later when I do actually build up and work on a project. Being a visual learner, it might not be a bad idea to use flow charts, instead of jumping into the code then being lost later, I could go back to my chart so I know what I need to do, and in what order.

Thursday, March 20, 2014

Weekly Reflection #7

I actually don't have much to write about at all this week. Chapter 7 went in full detail about using the debugger. To sum up this chapter I've learned that wrting the programs is only half the work when making games, the next step is making sure the code that I wrote actually works and that's where debugging comes in. Python's Shell actually has a debugger control. Debuggers pretty much let the programmer go through everysingle line of code, one line at a time while examining which lines execute (in what order) and what values the variables contain.
The debugger control in action.
All in all using the debugger is a great way to understand what exactly a program is doing, it's just a very slow process to me. I feel like it would be a lot more effective to run your project, test all of the functions and which ever function isn't working, go to that line of code and adjust accordingly.

Sunday, March 16, 2014

Weekly Reflection #6

This week I dived into the "Dragon Realm" game. I was introduced to a new way of creating my own game using what I've learned thus far. There hasn't been much to go off of in this chapter because there the reader is just introduced to a code and given a breakdown of how it works.

 In this chapter I learned how to create my own function using the def statement. The def statement is used to define my own made up function that I can later define. The code inside the function is run when the program calls for that function. I also learned that the inputs for functions are the arguments we pass when we make a function call. The function call itself evaluates to a value called the return value. The returned value is the output of the function. I also learned about variable scopes. Variables that are created inside of a function exist in the local scoape, and variables created outside of all functions exist in the global scope. Code in global scope can not make use of code in local scope.
Me playing the game. Going both paths.

Saturday, March 8, 2014

Weekly Reflection #5

This week I didn't really have time to mess around with my hobby but in this chapter I started to learn how to make a program that tells jokes using the print() and input() function. In my book this section was probably one of the shorter chapters. The syntax set up like so; 
  1. print('What do you get when you cross a snowman with a vampire?') #box pops up with joke
  2. input() #play has to hit enter
  3. print('Frostbite!') //after input (enter) is given the joke is told
  4. print() #he third print() function call is just for the sake of spacing
Here we have three print() function calls because we don't want to tell the player what the joke's punch line is, we have a call to the input() function after the first print(). The player can read the first line, press Enter, and then read the punch line.I only got about that far in this chapter due to family related issues.

I took what I learned in the last chapter then applied it here.