fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int gameBoard[4][4] = {0};
  5.  
  6. int displayGame();
  7. void test();
  8.  
  9. int main()
  10. {
  11. bool zeroFound;
  12. int k = 0;
  13. while(zeroFound == false && k < 4)
  14. {
  15. if(gameBoard[3][k] == 0) {
  16. gameBoard[3][k] = 2; zeroFound = true;
  17. }
  18. k++;
  19. cout << gameBoard[3][k];
  20. }
  21.  
  22. void test();
  23. return 0;
  24. }
  25.  
  26.  
  27. void test()
  28. {
  29. for(int i = 0; i < 4; i++)
  30. {
  31. for(int j = 0; j < 4; j++)
  32. {
  33. cout << gameBoard[i][j] << " ";
  34. }
  35. cout << endl;
  36. }
  37. }
Success #stdin #stdout 0s 3336KB
stdin
Standard input is empty
stdout
Standard output is empty