Sunday, April 6, 2014

Weekly Reflection #9

In this chapter, I made use of the flow charts from the previous chapter to start making my hangman game. The hangman game consist of ascii art utilizing Multi-line strings. 
HANGMANPICS = ['''

  +---+
  |   |
      |
      |
      |
      |
=========''', '''
...the rest of the code is too big to show here...

Above is an example of what hangman would look like using ascii art(text art). This chapter was really long and several new concepts(Methods, for loops, Else-if statments..etc) which I'm still trying to wrap my head around where introduced. Methods are just like functions, except that are associated with values. Methods return values just like functions return values. For loops iterate over the items in a list. The range() function is often used with for loops because it's an easy way to create  lists of sequential numbers. Else-if statements, used in python as elif will execute their block if their condition is true and the previous if and elif conditions are false(booleans, true or false conditions). So far, Hangman has been the most advanced yet introduced in the book. With this known, I definitely understand why it's a good idea to use a flow chart.

No comments:

Post a Comment