+int
+GetInt() {
+ static char intStr[16];
+ int intStrLen = 0;
+ int result = 0;
+ int c;
+ while ((c = getch()), (c != '\r') && (c != '\n')) {
+ if (c == 8 && intStrLen > 0) {
+ intStrLen--;
+ intStr[intStrLen] = '\0';
+ result /= 10;
+ Draw(g_Node, intStr);
+ }
+ else if (intStrLen < 16 - 1 && (c >= '0' && c <= '9')) {
+ intStr[intStrLen++] = c;
+ intStr[intStrLen] = '\0';
+ result *= 10;
+ result += c - '0';
+ Draw(g_Node, intStr);
+ }
+ }
+ return result;
+}
+