HOw to create "turtle Graphics" program using C

Please support our C++ advertiser: Intel Parallel Studio Home
Closed Thread

Join Date: Apr 2005
Posts: 5
Reputation: thlegendkiller is an unknown quantity at this point 
Solved Threads: 0
thlegendkiller thlegendkiller is offline Offline
Newbie Poster

HOw to create "turtle Graphics" program using C

 
0
  #1
Apr 24th, 2005
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
Quick reply to this message  
Join Date: Mar 2004
Posts: 219
Reputation: BountyX is an unknown quantity at this point 
Solved Threads: 8
BountyX's Avatar
BountyX BountyX is offline Offline
Code Guru

Re: How to create "turtle Graphics" program using C

 
0
  #2
Apr 25th, 2005
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.
A Hacker's Mind:
"I thought what I'd do was, I'd pretend I was one of those deaf-mutes..." - J.D.Salinger
Quick reply to this message  
Join Date: Jun 2006
Posts: 3
Reputation: Carlitta87 is an unknown quantity at this point 
Solved Threads: 0
Carlitta87's Avatar
Carlitta87 Carlitta87 is offline Offline
Newbie Poster

Re: How to create "turtle Graphics" program using C

 
-1
  #3
Jun 27th, 2006
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
Quick reply to this message  
Join Date: Apr 2004
Posts: 4,361
Reputation: Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future 
Solved Threads: 241
Team Colleague
Dave Sinkula's Avatar
Dave Sinkula Dave Sinkula is offline Offline
long time no c

Re: HOw to create "turtle Graphics" program using C

 
0
  #4
Jun 27th, 2006
Thanks for resurrecting a thread to point that out.
: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
Quick reply to this message  
Closed Thread

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C++ Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC