Page 1 of 5 123 ... LastLast
Results 1 to 10 of 50

Thread: Turtle Graphics...??

  1. #1
    Join Date
    Feb 2005
    Posts
    418
    Rep Power
    0

    Default Turtle Graphics...??

    Ok in the Deitel book ex 6.23... there is this question... i dunno how to attempt it.. and i want to get it done... does anybody especi the UTECH massive have the code for this already so i can have a look @ it ?


    this is the question for those with out the book that wish to be of some assistance // wishful thinking

    The Logo language, which is popular among young computer users made the concept of Turtle graphics famous, Imagine a mechanical turtle that walks around the room under the control of a C program. The turtle holds the pen in one of two positions. Up or down. When the pen is down, the turtle traces out shapes as it moves. When the pen is up, the turtle moves about freely without writing anything. In this problem you will simulate the operation of the turtle and create a computerized sketchpad as well.
    Use a 50 by 50 array floor that is initialized to Zeros. Read commands from an array that contains them. Assume the turtle always starts at position (0,0) of the floor with its pen up. The commands your script must process are as follows:
    Command Meaning
    1 Pen up
    2 Pen down
    3 Turn right
    4 Turn left
    5, 10 Move forward 10 spaces or a number other than ten
    6 Print the 20 by 20 array
    9 End of data (sentinel)

    Suppose that the turtle is somewhere near the center of the floor. The following program would draw and print a 12 by 12 square and then leave the pen in the up position:
    2
    5, 12
    3
    5, 12
    3
    5, 12
    3
    5, 12
    1
    6
    9

    As the turtle moves with the pen down set the appropriate elements of the array floor to 1s. When the 6 (print) command is given, display an asterisk wherever there is a 1 in the array. Wherever there is a zero display a blank.
    I need to write a program to implement the turtle graphics capabilities discussed here.
    ***Note to the public***
    Since ppl are a tad bit confused as to whether i happen to be male/female... i hope this will clear the air i am a FEMALE .. so stop wid da my ute/nigga/dog/man/boy beast ting!!
    ive spoken

  2. #2
    Join Date
    Jul 2002
    Posts
    818
    Rep Power
    0

    Default Re: Turtle Graphics...??

    Show of hands for those who are as lost as I am

    I get the basic concept but don't know enough C right now to assist. Best I could do is help you put together the pseudocode which I never use, so I'm probably not very good at that either.
    -I didn't spel chek.
    The stuff I do

  3. #3
    Join Date
    Feb 2005
    Posts
    418
    Rep Power
    0

    Default Re: Turtle Graphics...??

    Quote Originally Posted by CKnight
    Show of hands for those who are as lost as I am
    me too... hmm.. i dont kno what to do... cho
    ***Note to the public***
    Since ppl are a tad bit confused as to whether i happen to be male/female... i hope this will clear the air i am a FEMALE .. so stop wid da my ute/nigga/dog/man/boy beast ting!!
    ive spoken

  4. #4
    Join Date
    Jul 2002
    Posts
    818
    Rep Power
    0

    Default Re: Turtle Graphics...??

    Quote Originally Posted by Liquid Bunny
    i dont kno what to do... cho
    What you should do is have at it. It sounds like an interesting project. The best I could do is look for a mindsweeper project I did a few years back. It was done in Pascal so it should be easy to follow for a C minded person like yourself. It has a similar premise, a x by y array with multiple states, yadda yadda yadda.

    Where did I put that diskette...?
    -I didn't spel chek.
    The stuff I do

  5. #5
    Join Date
    Feb 2005
    Posts
    418
    Rep Power
    0

    Default Re: Turtle Graphics...??

    ok well if u find it .. u can PM me
    ***Note to the public***
    Since ppl are a tad bit confused as to whether i happen to be male/female... i hope this will clear the air i am a FEMALE .. so stop wid da my ute/nigga/dog/man/boy beast ting!!
    ive spoken

  6. #6
    Join Date
    Oct 2004
    Posts
    4,814
    Rep Power
    24

    Default Re: Turtle Graphics...??

    cing that i am no longer a utech student. do i qualify?

  7. #7
    Join Date
    Feb 2005
    Posts
    418
    Rep Power
    0

    Default Re: Turtle Graphics...??

    but of course... how could i possibly deny u ?
    ***Note to the public***
    Since ppl are a tad bit confused as to whether i happen to be male/female... i hope this will clear the air i am a FEMALE .. so stop wid da my ute/nigga/dog/man/boy beast ting!!
    ive spoken

  8. #8
    Join Date
    Oct 2004
    Posts
    4,814
    Rep Power
    24

    Default Re: Turtle Graphics...??

    sweet!!! . i'll take a good long look at it. btw is that a sch project or a personal attempt at learning c?

  9. #9
    Join Date
    Feb 2005
    Posts
    418
    Rep Power
    0

    Default Re: Turtle Graphics...??

    um.. which would u prefer to hear? which ever one will make u help me faster is my choice
    ***Note to the public***
    Since ppl are a tad bit confused as to whether i happen to be male/female... i hope this will clear the air i am a FEMALE .. so stop wid da my ute/nigga/dog/man/boy beast ting!!
    ive spoken

  10. #10
    Join Date
    Feb 2005
    Posts
    1,227
    Rep Power
    0

    Default Re: Turtle Graphics...??

    think i did something similar outa practice like 2 years ago....suppopsed to have it on my hard drive




    but then....i dont have a computer to put it on

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •