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.

No comments:

Post a Comment