Thread: Changing or updating output

  1. #1
    Registered User IdioticCreation's Avatar
    Join Date
    Nov 2006
    Location
    Lurking about
    Posts
    229

    Changing or updating output

    Hey

    I'm having trouble figuring out how to change an out putted result, because I don't really know what to search for.

    An example would be a tic tac toe game where the board is printed using underline "____" and pipes "|" Then when the player picks where they want to put their x, instead of printing out a whole new updated board, the old board is updated.

    Sorry, I'm not very good at explaining something like this.

    David

  2. #2
    Registered User
    Join Date
    Jan 2005
    Posts
    7,366
    You will likely have to use some sort of non-standard method for accomplishing this (maybe the backspace character is standard, I'm not sure).

    Try adrianxw's console tutorial for ideas on how to do this.

  3. #3
    Registered User IdioticCreation's Avatar
    Join Date
    Nov 2006
    Location
    Lurking about
    Posts
    229
    Thanks, I'll look into it.

    EDIT: Well I found adrian's site but I wasn't able to find his tutorials. I did find this

    Code:
    void gotoxy(int x, int y)  
    { 
    	HANDLE hConsoleOutput;
    	COORD dwCursorPosition;
    
    	dwCursorPosition.X = x;
    	dwCursorPosition.Y = y;
    	hConsoleOutput = GetStdHandle(STD_OUTPUT_HANDLE);
    	SetConsoleCursorPosition(hConsoleOutput,dwCursorPosition);
    }
    I think it is what I need, but I don't know.
    Last edited by IdioticCreation; 11-29-2006 at 07:31 PM.

  4. #4
    Registered User
    Join Date
    Nov 2006
    Posts
    519
    Youre using windows?
    here is a port of ncurses to it. it is able to do what you want and much more. you can think of it as a kind of gui-framework for the terminal.
    http://www.baldwin.cx/~john/projects/WinCurses.html

  5. #5
    Registered User IdioticCreation's Avatar
    Join Date
    Nov 2006
    Location
    Lurking about
    Posts
    229
    Quote Originally Posted by pheres
    Youre using windows?
    here is a port of ncurses to it. it is able to do what you want and much more. you can think of it as a kind of gui-framework for the terminal.
    http://www.baldwin.cx/~john/projects/WinCurses.html
    Thats what I was looking for, thank you.

  6. #6
    Registered User IdioticCreation's Avatar
    Join Date
    Nov 2006
    Location
    Lurking about
    Posts
    229
    Hey, I can't find any tutorials over WinCurses and I'm not quite sure how I use it. Do I just need to include the CURSES.H? Then how can I learn how to use it?

  7. #7
    Registered User
    Join Date
    Nov 2006
    Posts
    519
    as the author mention it's a port of ncurses I guess
    http://www.google.com/search?q=ncurs...UTF-8&oe=UTF-8
    shoud do well.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. execl()/fork() output
    By tadams in forum C Programming
    Replies: 19
    Last Post: 02-04-2009, 03:29 PM
  2. Replies: 12
    Last Post: 05-28-2008, 04:10 AM
  3. strange virtual function output
    By George2 in forum C++ Programming
    Replies: 4
    Last Post: 02-08-2008, 08:08 AM
  4. Basic C input output program help
    By trevordunstan in forum C Programming
    Replies: 2
    Last Post: 01-27-2008, 06:41 PM
  5. Trying to store system(command) Output
    By punxworm in forum C++ Programming
    Replies: 5
    Last Post: 04-20-2005, 06:46 PM