![]() |
|
#1
|
|||
|
|||
Define the entry point for a console applicationHello. Im trying tom make a number game and need some help. as seen in the code bellow it loads a few numbers from "start.txt". from start.txt it loads the numbers "1,2,3,4,5,6,7,8,X" and places it in a 3*3 grid. what i need some help with is X. i need to be able to move around around X inside the grid with "W A S D" but cant figure out how to do it
CPP / C++ / C Code:
Last edited by admin : 08-Oct-2008 at 23:01.
Reason: Please insert your example C/C++ codes between [CPP] and [/CPP] tags
|
|||
|
#2
|
|||
|
|||
Re: Need some newbie guidenceQuote:
Quote:
My suggestion in creating the logic for cursor movement is to track the location of 'X' by its (row, column) position. The logic you need to implement is:
|
|
#3
|
|||
|
|||
Re: Need some newbie guidenceQuote:
Exactly! |
|
#4
|
|||
|
|||
Re: Need some newbie guidenceQuote:
One thing you have not asked or mentioned is how you will be displaying the board. If this to be done at the console in text-based graphics:
At this point, you should be developing the basic engine described above, & ensuring that you get the expected behaviour upon any keypress. |
|
#5
|
|||
|
|||
Re: Define the entry point for a console applicationRight, reprinting the grid and letting things scroll up would be the simplest for now
but if you decide to get fancy here are some links that helped me learn how to 'handle' the screen: MS : microsoft.com/en-us/library/ms682010(VS.85).aspx , adrianxw.dk/SoftwareSite/Consoles/Consoles1.html or in Linux 'ncurses' : tldp.org/HOWTO/NCURSES-Programming.html But keep in mind that this forum is for questions regarding the languages themselves. Graphical programming is a different subject and so you won't get much help on that. |
Recent GIDBlog
Toyota - 2009 May Promotion by Nihal
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Need review of Python Tutorial Book for newbie | agiduser | Python Forum | 4 | 29-Feb-2008 16:41 |
| Newbie questions regarding inputing a sentence | Emir | C Programming Language | 2 | 10-Dec-2007 10:26 |
| Newbie : need help with Dev-C++ compiler | batrsau | C++ Forum | 2 | 20-Mar-2005 22:05 |
| linked lists, newbie needs help | moltarim | C Programming Language | 4 | 06-May-2004 12:32 |
| newbie using Sam's series | Skampy | C++ Forum | 3 | 06-Mar-2004 19:51 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The