| | |
HOw to create "turtle Graphics" program using C
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Apr 2005
Posts: 5
Reputation:
Solved Threads: 0
good day,
I am an incoming 2nd year IT student and am encountering a problem in creating a "turtle graphics"(from the famous Logo Language) program using C. This case is found in the book of deitel and deithel, "C how to program" in the chapter of Arrays.
it has almost been a week, and still haven't finish 1/8 of the program..
pls.. i really need help!!!
tnhank you!!!!
-patrick
I am an incoming 2nd year IT student and am encountering a problem in creating a "turtle graphics"(from the famous Logo Language) program using C. This case is found in the book of deitel and deithel, "C how to program" in the chapter of Arrays.
it has almost been a week, and still haven't finish 1/8 of the program..
pls.. i really need help!!!
tnhank you!!!!
-patrick
Using Standard Code:
1. You need a class to tell the turlte, aka the pen, direction, color, steps, etc.
2. You need a console menu that can input direction, steps, color, etc
3. You need to draw the turtle using a specific character like '@'. Instead of dynamically outputting the characters to the console output, you should use a matrix to define the "canvas". Then you can just print the matrix. This illiminates display problems and gives your tutle a working region. Be sure to prevent out of index problems with your matrix.
Using The Windows Api:
1. You need a class to tell the turlte, aka the pen, direction, color, steps, etc.
2. You need a windows API implementation of an editable client area that supports user input for direction, steps, color, etc.
3. You need to create a buffered BMP file in memory then draw the turtles action to that buffer. When you are done drawing on the buffer BitBlt the BMP resource to a client region (if you are using a resource script this should already be defined in the rc file).
Wasn't sure if you wanted to actually draw graphics or to just print letters on a console window, so I gave you a short how-to in both.
1. You need a class to tell the turlte, aka the pen, direction, color, steps, etc.
2. You need a console menu that can input direction, steps, color, etc
3. You need to draw the turtle using a specific character like '@'. Instead of dynamically outputting the characters to the console output, you should use a matrix to define the "canvas". Then you can just print the matrix. This illiminates display problems and gives your tutle a working region. Be sure to prevent out of index problems with your matrix.
Using The Windows Api:
1. You need a class to tell the turlte, aka the pen, direction, color, steps, etc.
2. You need a windows API implementation of an editable client area that supports user input for direction, steps, color, etc.
3. You need to create a buffered BMP file in memory then draw the turtles action to that buffer. When you are done drawing on the buffer BitBlt the BMP resource to a client region (if you are using a resource script this should already be defined in the rc file).
Wasn't sure if you wanted to actually draw graphics or to just print letters on a console window, so I gave you a short how-to in both.
A Hacker's Mind:
"I thought what I'd do was, I'd pretend I was one of those deaf-mutes..." - J.D.Salinger
"I thought what I'd do was, I'd pretend I was one of those deaf-mutes..." - J.D.Salinger
•
•
•
•
Originally Posted by BountyX
Using Standard Code:
1. You need a class to tell the turlte, aka the pen, direction, color, steps, etc.
2. You need a console menu that can input direction, steps, color, etc
3. You need to draw the turtle using a specific character like '@'. Instead of dynamically outputting the characters to the console output, you should use a matrix to define the "canvas". Then you can just print the matrix. This illiminates display problems and gives your tutle a working region. Be sure to prevent out of index problems with your matrix.
Using The Windows Api:
1. You need a class to tell the turlte, aka the pen, direction, color, steps, etc.
2. You need a windows API implementation of an editable client area that supports user input for direction, steps, color, etc.
3. You need to create a buffered BMP file in memory then draw the turtles action to that buffer. When you are done drawing on the buffer BitBlt the BMP resource to a client region (if you are using a resource script this should already be defined in the rc file).
Wasn't sure if you wanted to actually draw graphics or to just print letters on a console window, so I gave you a short how-to in both.
thats C++ though, not C
Thanks for resurrecting a thread to point that out.
:rolleyes:
:rolleyes:
"One of the methods used by statists to destroy capitalism consists in establishing controls that tie a given industry hand and foot, making it unable to solve its problems, then declaring that freedom has failed and stronger controls are necessary." --Ayn Rand
![]() |
Similar Threads
- Installing Windows 98 On VMware. Floppy problem (Windows 95 / 98 / Me)
- "Right Click Desktop" Generates a Crash - DrWatsn32 crashes too... (Windows NT / 2000 / XP)
- Turtle Graphics (Python)
- Error loading "bridge.dll" (Viruses, Spyware and other Nasties)
Other Threads in the C++ Forum
- Previous Thread: Convert CString to char*
- Next Thread: Need help with ifstream
| Thread Tools | Search this Thread |
api array based beginner binary bitmap c++ c/c++ calculator char char* class classes coding compile compiler console conversion convert count data database delete desktop developer directshow dll dynamiccharacterarray email encryption error file forms fstream function functions game getline google graph homeworkhelper iamthwee ifstream input int integer java lib linkedlist linux list loop looping loops map math matrix memory multiple news node number numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive reference return rpg sorting string strings struct template templates test text tree unix url vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets





