Commit 0a850637 authored by Max Kobelt's avatar Max Kobelt
Browse files

Rewrite while into for loop

parent c37bd8e1
......@@ -23,15 +23,11 @@ void initMenu() {
}
void calcMenu() {
int key = GetKeyPressed();
while (key > 0) {
for(int key = GetKeyPressed(); key > 0; key = GetKeyPressed()) {
// 0-9, A-Z and a-z
if (((key >= KEY_ZERO && key <= KEY_NINE) || (key >= KEY_A && key <= KEY_Z) || (key >= 97 && key <= 122)) && letterCount < MAX_INPUT_CHARS) {
name[letterCount++] = key;
}
key = GetKeyPressed();
}
if (IsKeyPressed(KEY_BACKSPACE) && letterCount > 0) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment