#include "stdafx.h"#include <iostream>using namespace std;int main (){ bool quitGame = false; int moveDirection = 0; while (!quitGame) { int x = 0; int y = 0; cout << "Current Position: " << x << "," << y << endl; cout << "Enter a direction" << endl; cout << "1) North 2) South 3) East 4) West 5) Quit "; cin >> moveDirection; switch (moveDirection) { case 1: x++; case 2: x--; case 3: y++; case 4: y--; case 5: quitGame = true; } }}
The first part works, but it won't loop, even if quitGame is evaluated false
[EDIT: If someone could tell me how to block code, that would be awesome. bbCode tags don't seem to work]