![]() |
| | #1 |
| Registered User Join Date: Nov 2009
Posts: 3
| would it be possible to use gotoxy? for example: void print(ifstream& input, ofstream& output); void gotoxy(int x, int y); void print(ifstream& input, ofstream& output) { int x, y; COORD coord; coord.X = x; coord.Y = y; ... ... ... |
| jakevinraymundo is offline | |
| | #2 |
| Registered User Join Date: Nov 2009
Posts: 3
| btw, i used the windows.h library.. are there any libraries that I could possibly use? |
| jakevinraymundo is offline | |
| | #3 |
| 3735928559 Join Date: Mar 2008
Posts: 693
| i don't understand what you mean. by "determine the XY coordinates of a character" do you mean the line and column number of a particular character in the console buffer or what? |
| m37h0d is offline | |
| | #4 |
| Registered User Join Date: Nov 2009
Posts: 3
| by XY, I mean rows,columns For example, you are given the following text file and you are to determine the coordinates of Xs.. XOOXOOXXOX XOOXOOOOOX XOXXOOOXOO The output would be: “The coordinates of the # signs are: 1,1/1,4/1,7/1,8/1,10 2,1/2,4/2,10 3,1/3,3/3,4/3,8" |
| jakevinraymundo is offline | |
| | #5 |
| 3735928559 Join Date: Mar 2008
Posts: 693
| ok, so what are you confused about? |
| m37h0d is offline | |
| | #6 |
| Registered User Join Date: Jul 2009
Posts: 46
| What code do you have that you can show us? For starters, try putting the contents of the text file into a 2D array and looping through that to find the X's. |
| crowe is offline | |
| | #7 |
| 3735928559 Join Date: Mar 2008
Posts: 693
| that's probably not the best strategy imo. i would read the file 1 character at a time, while maintaining column and row counters and push_back their current values onto a vector of coords whenever you find the needle in the haystack. Last edited by m37h0d; 11-04-2009 at 09:37 AM. |
| m37h0d is offline | |
![]() |
| Tags |
| xy coordinates |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to get relative mouse coordinates when GLUT return absolute | joeprogrammer | Game Programming | 14 | 02-10-2009 06:35 PM |
| Adventures in labyrinth generation. | guesst | Game Programming | 8 | 10-12-2008 01:30 PM |
| Global coordinates in OpenGL? | IcyDeath | C++ Programming | 1 | 11-25-2004 06:29 PM |
| Converting from Screen to World Coordinates | DavidP | Game Programming | 9 | 05-11-2004 12:51 PM |
| Size of 1 pixel | ooosawaddee3 | C++ Programming | 4 | 07-26-2002 08:06 PM |