User Profile

Collapse

Profile Sidebar

Collapse
ccgrl451
ccgrl451
Last Activity: Jan 11 '10, 05:36 AM
Joined: Nov 25 '09
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • ccgrl451
    started a topic What's my errors?

    What's my errors?

    Code:
    ##Christy Pham
    ##Creative Computing, 4
    ##December 18, 2009
    
    from turtle import *
    from random import*
    
    class Pacman(Turtle):
        def __init__(self):
            Turtle.__init__(self)
            register_shape("pacman.gif")
            self.shape("pacman.gif")
    
        def move_randomly(self):
            self.fd(randint(10,30))
            self.rt(90)
    ...
    See more | Go to post
    Last edited by bvdet; Jan 9 '10, 12:06 AM. Reason: Add code tags

  • Why does this relatively simple code keep giving me errors?!?!?

    Okay, so here is the exercise I'm trying to complete. Create a turtle object in turtle graphics in a coin field, with each coin an object itself. Make the turtle randomly move while simultaneously collecting/eating coins(in my while loop, I used the random generator). As the turtle collects a coin, the turtle gets bigger and the coins should dissapear from the screen(also in my while loop, I made the shapesize increase,the coin it contacted white)....
    See more | Go to post

  • ccgrl451
    replied to What's wrong with this code, part 2.
    Sorry this took too long to check. I was busy. Thanks this helped me tons. Also, the link to the posting guidelines are great for future reference!
    See more | Go to post

    Leave a comment:


  • ccgrl451
    started a topic What's wrong with this code, part 2.

    What's wrong with this code, part 2.

    Okay, so you probably haven't seen my previous question, whats wrong with this code. For those who have, you know what I'm talking about. If not, heres what I have to do.



    We have to do this using object-oriented coding. We don't have to use classes, but I just chose to do so. This also needs to happen in turtle graphics. Heres my code:

    Code:
    from turtle import *
    from random import *
    
    def
    ...
    See more | Go to post

  • ccgrl451
    replied to What's wrong with this code?
    Yeah, I thought that I was doing it wrong. But I'm not sure I understand this. Are you saying that I need to put my classes pyramid and lost_turtles behaviors in a def __init__ function? Sorry, could you explain how I would redifine the classes in my code. Thanks.
    See more | Go to post

    Leave a comment:


  • ccgrl451
    started a topic What's wrong with this code?

    What's wrong with this code?

    Activity 2: Find the Pyramid
    Randomly place a pyramid (yellow, large turtle) on the screen. Have a second turtle move
    randomly until it is close to the pyramid. Stop the seeking turtle once it has found the pyramid.

    So here's my code.

    from random import*
    from turtle graphics*

    class pyramid:
    pyramid=Turtle( )
    pyramid.shape(" triangle")
    pyramid.color(" yellow")
    ...
    See more | Go to post

  • ccgrl451
    replied to Need help coding?
    Well, I understand some of it, but could you explain each line. More specifically, line 3(why do you need to import string?),line 11 (what does "return A do?), and the whole for loop. Thanks!
    See more | Go to post

    Leave a comment:


  • ccgrl451
    started a topic Need help coding?

    Need help coding?

    Okay, just to let you know, I am a certified noob, so I'm not really sure what to do. Here's what I"m supposed to do. Write a function three_heads that stimulates flipping a coin repeatedly printing what is seen (H for heads, T for tails). When 3 heads are flipped in a row, a message is printed. Here is a sample output:

    T
    H
    T
    H
    H
    H
    Three Heads in a row!



    This isn't...
    See more | Go to post
    Last edited by bvdet; Nov 25 '09, 04:05 PM. Reason: Add code tags
No activity results to display
Show More
Working...