On 8/19/06, alex_merlin_1985 <[EMAIL PROTECTED]> wrote: > ok, first, this code will stay as it is, I won't move it to Visual, I > just want to get done with it. Maybe after finished with this I will > remake a totaly new version, but that's the future...
Well, it's likely you won't get much help from the more experienced folks here since no one else is running the same compiler and probably haven't used BGI in over a decade. I don't think I've touched BGI code since maybe 1993 or 1994... > Well, the purpose of this is to ask the player to type in his name > (this will be a "Five in a row" game). > The name1[25] can also be name1[100] or whatever, and the length can > be limited if the player inputs "somehow", 200 or more chars (but why > would do that? :-)) Never assume what the length of the input will be. fgets() is useful in that you can specify the limit of what can be entererd. > So, if you could provide me with the code for input a string in BGI > mode, that works well (and doesn't read from file), would be really > great and nice! fgets() or cin are the best ways to get keyboard input. BGI doesn't interact with the console (keyboard & terminal), it only knows about the bitmapped video display (via the driver library). If you want to use the graphic interface correctly, you should create a window (a text input box) and only allow text entry in that box... but then you have to include logic for making that window the active one via a mouse click (for which you'll have to write you own mouse driver) or keyboard... but then again, if you are going to that trouble, why not just use Windows, so you can worry about your game logic and not the I/O, which is going to be clumsy at best with BGI unless you create a more sophisticated UI. -- Brett McCoy: Programmer by Day, Guitarist by Night http://www.alhazred.com http://www.cassandrasyndrome.com http://www.revelmoon.com To unsubscribe, send a blank message to <mailto:[EMAIL PROTECTED]>. Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/c-prog/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
