PDA

View Full Version : turtle graphics in c++


nissanracer29
10-27-2007, 10:02 PM
Hello guys, I am working on a program in c++ called turtle graphics. Have any of you c++ guys heard of this? I have figured out how to print the 2D array. I am stuck on how to get my turtle to move to certain positions on the array. The ultimate goal of this program is to draw and display shapes according to the users input to the turtle. Anyways I just figured I would ask here and see if anyone has had any experience with c++ and this type of program. Any and all help will be greatly appreciated! Thanks :)

nissanracer29
10-28-2007, 10:05 AM
bump anyone???

240_whore
10-28-2007, 01:17 PM
I learned C++ and Python to fiddle around with BF2 and make a mod... never got anywhere...

Anyhoo, sorry I've yet to hear about turtle. I'll ask the dad and see if I can help you though. He's a programmer. We'll see.

nissanracer29
10-28-2007, 01:33 PM
Thanks man I would appreciate it. Im still sitting here trying to figure out how to do this program. Here is the problem that I am working on: (turtle Graphics) The Logo language, which is popular among elementary school children, 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 a pen in one of two positions, up or down. While the pen is down, the turtle traces out shapes as it moves; while the pen is up, the turtle moves about feely without writing anything. In this problem you will simulate the operation of the turtle and create a computerized sketchpad as well.
Use a 20 by 20 array floor that is initalized to zeros. Read commands from an array that contains them. Keep track of the current position of the turtle at all times and whether the pen is currently up or down. Assume that the turtle always starts at position (0,0) of the floor with its pen up.

I hope you can help me with this. Thanks

240_whore
10-28-2007, 06:23 PM
Hey My dad said it'd been forever since he played around with C++, but I'm a member of a computer forum, and I posted a thread there. Seemed more "in place" in a computer forum :P. The link to the thread is

http://incrysis.com/forums/viewtopic.php?pid=238847#p238847

Good luck.

pignose4life
10-28-2007, 08:23 PM
just make an if-then for your variables that have the points for your turtle and make it an addition equation in it.

nissanracer29
10-29-2007, 01:58 PM
thanks for posting it there for me 240_whore. Im going to work on it somemore tonight and see if I can get it to run. pignose4life can you explain to me what you mean? I think I have an idea but in not sure. Thanks

pignose4life
10-29-2007, 06:59 PM
basically say your variable is x and you would just make a do-while to move it
do {
x+5;
}while(x<100)
something to that extent i havent coded for a while if you really want me to help i can refresh my memory =]

nissanracer29
10-29-2007, 10:16 PM
basically say your variable is x and you would just make a do-while to move it
do {
x+5;
}while(x<100)
something to that extent i havent coded for a while if you really want me to help i can refresh my memory =]

If you dont care to that would be awsome! I have to get this done by next week monday. Im working at it to get it done. But if you could help me on this I would greatly appreciate it. Thanks man :)

pignose4life
10-29-2007, 10:47 PM
well just pm me all the code you have and im gonna try and find my old vb cd

nissanracer29
10-31-2007, 02:36 PM
well just pm me all the code you have and im gonna try and find my old vb cd


Ok thanks alot man!!! I am going to try and work on it somemore today. I will pm it to you tonight. Thanks again man!