Monday, January 31, 2011

Jan 31

OK the resources ill use for my goal will be the python book provided by the class and then ill also use the How to Think Like a Computer Scientist site. My plans are by the first week or by the second week ill be caught up on my questions with my chapters and will be well onto ether chapter 7 or chapter 8. By the third week I am planning on trying to build some sort of animation or action produced through python script. Examples are maybe making a program that allows you to press any button and then after pressing the button a animation will appear on the screen or something along those lines.
Continue onto Chapter 4 questions:
  1. >>> 5 % 2
 1
  1. >>> 9 % 5
4
  1. >>> 15 % 12
3
  1. >>> 12 % 15
12
  1. >>> 6 % 6
0
  1. >>> 0 % 7
0
  1. >>> 7 % 0
integer division or modulo by zero is the end result I get when i try to put 7%0 into python. Python does this because it cant get 7% of 0 when 0 has nothing in it.
#2: make a program
p      q     not p or q
=====================
True    True    True
True    False   True
False   True    True
False   False   False
 
p      q      p and q
======================
True    True    True 
True    False   False
False   True    False
False   False   False

p      q      not p and q
==========================
True    True    False
True    False   False
False   True    True 
False   False   False

 p      q      not(p) or not(q)
============================
True    True    True 
True    False   False
False   True    True 
False   False   True 

 p      q      not(p) and not(q)
============================
True    True    True 
True    False   False
False   True    True 
False   False   True 
After a few minutes I figured what they meant by changing "p or q" to stuff like "not p and not q".
#4:

Tuesday, January 25, 2011

Jan 24-25

 The name of my program/ goal for this quarter will be called "Something More"

 My goal for this quarter is to for one thing improve my understanding on more on what is python. I also wanna learn, instead of the code of random programs, but more of the code for design on what picture would pop up or what action the character on the screen will do if I press like for say space. I want to have a more visceral affect this quarter to where i can actually see more then just words pop up saying some random sentence. I want to try to see if I can try to build a program or just run a program that demonstrates multiple actions and/or movements of some figure on the screen.
Um ill finish up on my resources I'll b using and my time line sometime during this week.
 

Friday, January 21, 2011

Jan 21

OK well today I'm continuing on my exercises trying to catch back up to chapter 5. Um I'm starting out on chapter 2.  
#5:
float
str
'The knights who say "ni!"'
invalid syntax
'The knights who say "ni!"'
#6: bruce = 6
bruce + 4 = 10
#7: had to write a python program.
Chapter 3
#1: (I had a lot of difficulty with this question due to the fact that i instead had def new_lines(): instead of def new_line():. talk about one thing messing your program up).
def new_line():
    print
  
def three_lines():
    new_line()
    new_line()
    new_line()
    new_line()
    new_line()
    new_line()
    new_line()
    new_line()
    new_line()

three_lines()

def clear_screen():
    new_line()
    new_line()
    new_line()
    new_line()
    new_line()
    new_line()
    new_line()
    new_line()
    new_line()
    new_line()
    new_line()
    new_line()
    new_line()
    new_line()
    new_line()
    new_line()
    new_line()
    new_line()
    new_line()
    new_line()
    new_line()
    new_line()
    new_line()
    new_line()
    new_line()
    new_line()
  
clear_screen()
#2: When I move clear_screen() to the top of the program I get: Invalid syntax error.
#3: With me moving new_line() around the program, I got errors saying that new_line() is not defined and Invalid syntax.
Um ill continue this next week, I've learned from the program on #1, is that 1 error can cause everything to mess up no matter how small the error is.

Thursday, January 20, 2011

Jan 20

Alright today I'm gonna review the first few chapters that I have done on the How to Think Like a Computer Scientist site, i'll do a quick read through then add my exercises to this.
 Chapter 1 Exercises:
#1: print "hello, how are you"
print "Hello, how are you?"
#2: When I add the / into an equation, it causes the equation to divide. Like for example: 2 + 2 will equal 4, but when u substitute + for / you'll get 1 instead of 4. This is caused by the problem changing from a addition problem to a division problem.
#3: more examples of errors are:
2 3 invalid syntax
3***2 invalid syntax
ill stop at two examples because I've come to notice that all the numbers that I apply to python without accurate equation symbols will end in a invalid syntax error.
#4: When I added the " " into print "hello" I got the same results as I did for when I put in print 'hello'. I got hello without any quotation marks.
#5: no question for this one
#6: This one is to make a test1.py file
OK well that wraps up chapter 1.
Chapter 2 Exercises:
#1: When I code: print n = 7, I get a syntax error saying that its a invalid syntax. When I apply print 7 + 5 I get a end result of 12. I also had to print 5.2, "this", 4 - 2, "that", 5/2.0 and got 5.2, this, 2, that, and 2.5. I noticed that even though, without adding quotations to like 7+5 to get 7+5 as a end result instead of getting 12. I could also instead of putting print 7 + 5, I could simply just put in 7 + 5 to get the end result of 12.
#2: n = "All work and no play "
p = "makes Jack a dull boy."
n + p = "All work and no play makes Jack a dull boy."
#3: To make 6 * 1 - 2 equal -6 then 4, u add parenthesis where 6*(1-2) so that after 2 is taken from 1 you get -1. Then -1 * 6 will equal -6.
#4: When I add a comma in front of n + P from question #2, I get a syntax error. Python response by saying that the comma is a invalid syntax.
Um due to time, ill continue this next class from question #5. 

Wednesday, January 19, 2011

Jan 19

Alright I'm gonna start this week of by finishing up on the last bits on chapter 4 on the How to Think Like a Computer Scientist. I'm basically done with this chapter, I'm on 4.7 Nested Conditionals. Um I think I may double back on some of the chapters on the How to Think Like a Computer Scientist site. Just so that I can remember more of those terms.

Friday, January 14, 2011

Jan 14

OK well I'm switching back to the Internet site to practice more on python. I'm just finishing up on chapter 3 and gonna start on 4 and see whats gonna happen then.

Thursday, January 13, 2011

Jan 13

Um well today I'm gonna try the book again to see how I do. Gonna try to get a few pages done.

Jan 12

So well sense today is gonna be short, I'm just gonna reading a few more pages on the site. Um I really don't know what exactly I'm doing today besides that.

Tuesday, January 11, 2011

Jan 11

OK, well today I've been using one of the sites and I found that I like the one Mr.Elkner had helped make: http://openbookproject.net. This really isn't that bad of a description on what I'm suppose to do, its really clear.

Jan 10

This week I'm gonna be trying to find a new practice program for python so I can get more practice on python. For now ill just look through the sites Mr. Elkner sent to me.

Friday, January 7, 2011

Jan 7

Okay well starting off today I had to input the tankgame.py. Well I put in all the code as the book told me to do but when i went to run the program its saying I have an error. I'm gonna read a little more on the next couple pages to see if that was suppose to happen.
OK well I've fixed the first problem, but now its saying theres a new error on line 3 instead of line 1. It says object___new__() takes no parameters. I really don't understand what it means but ill keep working on this to see if I can fix this.
Thanks to Mr. Elkner, I found out that i need instead of 1 _ for def _init_(self, name):, I need to have it like this: def __init__(self,name). This error also happened when I named who was being fired at and who was being hit, the code error was: def _str_(self) when I needed def __str__(self).

Thursday, January 6, 2011

Jan 6

Okay well today I'm gonna plan on trying to finish at least 5 pages. Right now I'm just finishing up on tuples and about to be on the unpacking section. I just finished one line of code and found out that tuples does not support append, so thats cool. I found some problems when it came to working on unpacking because instead of spacing while i was coding, I just kept the code together causing me to have to restart at least 5 times. I'm now starting on dictionaries. Okay while working with I found it quite easy until after that section was over and was on the final coding for that section. When they told me to add my_dictionary['sake']=19.95 and then put in my_dictionary it outputted {'sake': 19.949999999....}. So far I haven't found a way to fix this problem but for now I'm moving on. Okay i just finished the last of chapter 1 and will now continue on to working on chapter 2 starting at scripts.

Jan 5

So lets see, I was stuck for the first couple minutes due to I forgot to put in python when I first started out. After about 20 minutes I finally realized that I never put that in. Well looks like today I'll try to finish chapter 1.

Tuesday, January 4, 2011

First Day

Well, like the title says, its my first day in this class. I'm changing from my first thoughts of working on C++ to Python and Pygame. Ill be studying from the Beginning Game Development with Python and Pygame book. Um, i don't really have any experience using Python besides watching friends build 3-D rooms and other programs last year. I hope that these programs will help me with game design and hopefully help me understand more programs dealing with game design. Hopefully soon I will be able to finish my study on C++, but for now I'd rather stick to something easy like these programs.