Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Putting something at a specified coordinate on the screen

ITAITA Posts: 463Member
I'm trying to develop a version of Tic-Tac-Toe (Noughts and Crosses) for the Linux command line but I'm stuck. I want to be able to draw at a specific coordinate or point on the screen (x,y). For example I want to place a X at point (1,2). How do I do this? I've done the same thing with .NET, it was easy, simply use the Point class but I'm puzzled as to how to do it in C++. Does C++ have a Point class or do I have to develop my own?

The main question I'm asking is how do I put something at a specific point (coordinate) on the screen.

Many thanks.

ITA


Comments

  • stoberstober Posts: 9,765Member ✭✭✭
    there is no standard c or c++ solution for that because it is operating system and often compiler specific. for *nix you can use either QT or the older curses libraries. you have to download them from the net because they are not standard with most compilers. good for them and you will find them.


    : I'm trying to develop a version of Tic-Tac-Toe (Noughts and Crosses) for the Linux command line but I'm stuck. I want to be able to draw at a specific coordinate or point on the screen (x,y). For example I want to place a X at point (1,2). How do I do this? I've done the same thing with .NET, it was easy, simply use the Point class but I'm puzzled as to how to do it in C++. Does C++ have a Point class or do I have to develop my own?
    :
    : The main question I'm asking is how do I put something at a specific point (coordinate) on the screen.
    :
    : Many thanks.
    :
    : ITA
    :
    :
    :

  • Ed HallEd Hall Posts: 395Member
    : I'm trying to develop a version of Tic-Tac-Toe (Noughts and Crosses) for the Linux command line but I'm stuck. I want to be able to draw at a specific coordinate or point on the screen (x,y). For example I want to place a X at point (1,2). How do I do this? I've done the same thing with .NET, it was easy, simply use the Point class but I'm puzzled as to how to do it in C++. Does C++ have a Point class or do I have to develop my own?
    :
    : The main question I'm asking is how do I put something at a specific point (coordinate) on the screen.
    :
    : Many thanks.
    :
    : ITA
    :
    :
    :
    [blue]
    I've seen something somewhere that suggests "ncurses" may have a gotoxy() routine, but I'm not familiar in any way with that platform.

    Take Care,
    Ed
    [/blue]


Sign In or Register to comment.