473,320 Members | 1,699 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Turtle Graphics

I saw this program from a website... Any solution ?

Turtle Graphics: The Logo language, which is particularly popular among personal computer user, made the concept of turtle graphics famous. Imagine a mechanical turtle that walks around the room under control of c++ program. The turtle holds a pen in one of the 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 freely without writing anything. In this problem, you will simulate the operation of the turtle and create a computer sketchpad as well.
Use a 20-by-20 array floor that is initialized to zeros. Show movement of the turtle with pen down by marking #. The turtle always starts from 0,0. The set of turtle commands is as shown for printing a 12 X 12 square is shown below
2
5, 12
3
5,12
3
5,12
1
6
9
The meaning of the command can be followed from the table shown below

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 10)
6 Print 20 by 20 array
9 End of data


Write a c++ program to read the turtle command from a file and implement the turtle capabilities discussed here. Add other commands if required.
Sep 27 '07 #1
4 6796
oler1s
671 Expert 512MB
It's a common beginner type problem. Did you have an actual question?
Sep 27 '07 #2
Any code for this question ?
Sep 27 '07 #3
JosAH
11,448 Expert 8TB
Any code for this question ?
We're all staring in anticipation in your general direction because your assignment
wants you to produce that little application. When you're stuck with some particular
details we most likely can help you out.

kind regards,

Jos
Sep 27 '07 #4
Well i got a question. I have the same exercise in java and my only question is how are we gonna read the comma seperated values( in the case of the command 5,10 that is)..Thanks in advance! :D
Jul 11 '10 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: dbrown2 | last post by:
I typically use IDLE for editing and debug. On Windows at least, IDLE and the standard turtle graphics module do not mix. I think both use Tkinter. For now I use IPython and Jedit when using...
4
by: Brent W. Hughes | last post by:
If the Turtle gets himself into a large (or infinite) loop, is there any way to stop him other than Ctrl-Alt-Del? Brent
1
by: Brent W. Hughes | last post by:
I'm using the turtle graphics module and am trying to teach it to my kids. The slowness of the turtle in drawing things is good at first because it's fun watching it do its thing. But now we'd...
2
by: jevitop | last post by:
Hi, im looking for help on how to make a turtle graphics program. My head will explode trying to figure this out. if anyone can help me please do it, i'll appriciate it!!! Can anyone...
10
by: JulianP | last post by:
Hi I am working on a Turtle Program and I have put in all the fancy schmancy stuff in I just cant seem to figure out how to print the T, which is my turtle, on the screen. Here is the code for my...
7
by: Dick Moores | last post by:
I accidentally stumbled across the Turtle Graphics module (turtle.py) the other day and have been having some fun with it. Now I'm wondering if there is a way to build into a script the saving...
5
by: tomy | last post by:
Hi All I am a newbie to turtle graphics in python, so sorry if you find this question too easy. How can I get smoother lines in turtle graphics? I am using python on windows. Thanks in advance
1
by: Alexander.Oot | last post by:
I think the speed function may be broken from the turtle graphics package "from turtle import * speed('fastest') forward(50)"
1
by: Allen | last post by:
I'm using the turtle module in Python. Is there a way to save the turle state at any moment for recursive algorithms to easily return the turtle to an earlier point for another branch/etc? ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.