Powered By Blogger

Sunday, September 4, 2011

grid printer

I made a functionn that prints a grid x wide and y tall.
one of the problems I encountered is that the x would always be one to many because it would be 'x' + 'x'*x

Wednesday, August 31, 2011

I am ending the pig latin program

I spent 30 minuits at pycamp today
The sentence split is very difficult to use with the translater.

Tuesday, August 30, 2011

two programs in one

I spent 1 hour at pycamp today
I created a program that counts down from 10 to 1 with timing in between using a while loop.
I also created a function that takes any given number and multyplies it by a randome number

Monday, August 29, 2011

almost the end of the pig latin program urrayhay

today I spent 1 hour a pycamp
the split method is very useful when you need to turn a sentence into a list of separate words.
here is an example: sentence.split(' ')

commenting is very useful when you know that when you wil come back through your program you will know what a certain part dose.

the return command at the end of a defined function is used to give out the product of that function.

a flow chart is very important to use when you dont exactly know in what order you should do things.

Thursday, August 25, 2011

fermi pico bagles

I spent 1 hour at pycamp today,
I found out how to name a single letter in a word,
for my pig latin game.

Wednesday, August 24, 2011

pig latin

today I spent 1 hour at pycamp
I learned that python has a database of many many methods that can be used.
I am also learning about lists.
I am trying to solve the problem of not being able to cut individual items of a list into seperate pieces. for example take the word 'apple' and cut it up into 5 pieces the list that would show this 'cut up' apple wold look something like this word['a','p','p','l','e',]. I need this because I'm making a piglatin translator.

Tuesday, August 23, 2011

AI algorithems

I spant 1 hour today at pycamp
I leared that an ai can follow a set of rules to be able to win a tic tac toe game

Saturday, July 30, 2011

new game update

I spent 45 or more minutes today at pycamp MAKING! a game!

I created my first while loop that works but now I have to figure out how to get out of the while loop.
my games name is area 51 hack

Friday, July 29, 2011

my first game

today I spent 1:30 hours today at pycamp

I learned about if and else and elif witch is a combination of if and else.

My new game is about hacking into area 51 there are no images only text.

Thursday, July 28, 2011

lists

I spent 1 hour 50 minuits at PyCamp
I learned how to make a list and how to add things to a list and how to see things in a list.

Wednesday, July 27, 2011

local and global scope

I spent 45 minutes at "Py Camp" today.

when I hame a line of code that says:
def sayhello(name)
this is a local scope because this is a function witch can have many operations inside of it and can be called apon to do those things when needed. (name) is the local scope (it's a variable).

a global scope is a variable that is not in a function.

Tuesday, July 26, 2011

logical operators

I spent one hour at Camp.

I learned about logical operators like AND and OR. I also learned about the IF statement and TRUE and FALSE. Here is an example:

(Cats have whiskers.) AND (Dogs have tails) is TRUE.
(Cats have whiskers.) AND (Dogs have wings.) is FALSE.

Monday, July 25, 2011

the journey begins

This was Ben's first day learning Python. He is using 3.1 on OSX 10.6 and working through the book Invent Your Own Computer Games With Python by Al Sweigart. I've asked him to make a note of what he does each day and how long he spent at "Python Camp" that day.

I spent 2 hours.
I learned what the interactive shell is (the code input in python)
and I created my first game (in python that is) by copying from the book: a guess the number game!


# This is a guess the number game.
import random

guessesTaken = 0

print('Hello! What is your name?')
myName = input()

number = random.randint(1, 20)
print('Well, ' + myName + ', I am thinking of a number between 1 and 20.')

while guessesTaken < 6: print('Take a guess.') # There are four spaces in front of print. guess = input() guess = int(guess) guessesTaken = guessesTaken + 1 if guess < number: print('Your guess is too low.') # There are eight spaces in front of print. if guess > number:
print('Your guess is too high.')

if guess == number:
break

if guess == number:
guessesTaken = str(guessesTaken)
print('Good job, ' + myName + '! You guessed my number in ' + guessesTaken + ' guesses!')

if guess != number:
number = str(number)
print('Nope. The number I was thinking of was ' + number)