Computer Science Canada stopping repeated use of the return key |
Author: | gigaman [ Mon Nov 22, 2004 9:18 am ] | ||
Post subject: | stopping repeated use of the return key | ||
This is a part of my battleship code. i need to make sure that if the user presses enter without inputing a value the cursor remains in the same place.
|
Author: | Delos [ Mon Nov 22, 2004 9:48 am ] |
Post subject: | |
Use getch(). You'll need to put the input value onto the screen after it has been getch()ed as that routine does not return the inputted value to the screen. Also stick w/ your idea of locate()s. They'll do well w/ the input too. |
Author: | gigaman [ Tue Nov 23, 2004 9:27 am ] |
Post subject: | |
the problem with using getch is that it only takes 1 input character. i need it to take 1 or 2 characters as input because i need between 1 and 10 |
Author: | Delos [ Tue Nov 23, 2004 11:41 am ] |
Post subject: | |
Well...come on! You're in compsci! If you need a series of 10 inputs, and you have a reliable command that only takes 1 input... |