Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/forums/c/)
-   -   Question: Turtle Graphics Like Program (http://www.go4expert.com/forums/question-turtle-graphics-program-t1058/)

bhl88 24Jul2006 11:53

Question: Turtle Graphics Like Program
 
How do you...

1.) Do a freehand drawing while using number keys:
Ex: 1: NW 2: North 3: NE 4: East...etc...
2.) Go to row or col using arrow keys...
Up down left right

shabbir 24Jul2006 22:43

Re: Question: Turtle Graphics Like Program
 
Following code return the scan code of the key hit
Code: CPP

include <dos.h>
getkey()
{
    union REGS i, o;
    while(!kbhit());
    i.h.ah = 0;
    int86(22,&i,&o);
    return o.h.ah;
}

Now the code can help you to get the Scan code of the required number and then grphics programming can help you draw the object.

bhl88 29Jul2006 12:06

Re: Question: Turtle Graphics Like Program
 
How can I move the cursor using the numbers and switch so you can type measurements without moving the cursor. For example...
1: NW 2: North 3: NE 4: East
Pressing the number 1 moves you northwest....then when you type a letter, like s for shape (it will ask for dimensions)...you can type numbers normally again without moving the cursor....

in normal C language....

shabbir 29Jul2006 17:40

Re: Question: Turtle Graphics Like Program
 
Do you mean blinking cursor? Normally the cursor remains at the position you last output anything.

bhl88 1Aug2006 15:17

Re: Question: Turtle Graphics Like Program
 
Blinking cursor I guess....moving the part where you type up then when you type s and enter....the direction keys 1-9 now function back as number keys again and you can type the dimensions of whatever shape you like...

bhl88 2Aug2006 15:44

Re: Question: Turtle Graphics Like Program
 
3 Attachment(s)
(i dunno how to edit posts)

DJGPP as compiler
Language: C

Question: Same as last post

shabbir 2Aug2006 15:56

Re: Question: Turtle Graphics Like Program
 
Enter a line break where you want to place the cursor and then make gotoxy to that location and then print a character or two at the last and the cursor should remain there.

bhl88 9Aug2006 14:24

Re: Question: Turtle Graphics Like Program
 
1 Attachment(s)
I'm still having problems with my cursor...It is going off in random directions....do you have a code for it?


All times are GMT +5.5. The time now is 05:52.