Jump to content
  • Advertisement
Sign in to follow this  
jordi_0071

gotoxy

This topic is 4749 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

i've readed that gotoxy(); function is old and it's not supported in ms visual C++ 6. how can i set the cursor position then?

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by jordi_0071
i dont have msdn:P


www.msdn.microsoft.com

I forget the names of the funtions, as I've never used them. Sorry.

Share this post


Link to post
Share on other sites
hope this helps (taken from cprogramming.com) :


#include <windows.h>

void gotoxy(int x, int y)
{
COORD coord;
coord.X = x;
coord.Y = y;
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), coord);
}

Share this post


Link to post
Share on other sites
Quote:
Original post by jordi_0071
i've a other question: how do i not show my output:
What exactly are you doing? Is this for a menu screen, and you want the user to press a key and then react instantly without them pressing enter or seeing what they typed?

Try kbhit() (if you have that in vs++)

//
while (1)
{
if (kbhit())
{
//funtion to check last keypress... I think getch, or getc
}
}


It's been so long since I've used that, I forget all the specifics.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore98/html/_crt__kbhit.asp

Share this post


Link to post
Share on other sites
Quote:
Original post by jordi_0071
i'm writing a tic-tac-toe game.


So you show a board, then you have a menu beside or under it?

//really crappy example

while (1)
{
if (kbhit())
{
c = _getch();
strlwr(c); //<-- lower case conversion

if (c == 'q') Quit();


break;
}
}


Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!