Hello
I got this grid working as you can se in the code bellow, but when i try to make some printf (or cout) to make it show some numbers i only get "0 0 1 1 2 2" displayed in a line. anyone know why and how i could make it the display the grid & Numbers like it should?
Code:#include "stdafx.h" #include <iostream> #include <ctime> using namespace std; int main() { int grid[3][3]; // grid int count = 1; for(int i = 0; i < 3; i++){ for(int n = 0; n < 3; n++){ if(i == 2 && n == 2) break; // dont give out a number to square 9 grid[i][n] = count; // give out a number to square 1-8 count++; cout << i << endl; } } return 0; }



LinkBack URL
About LinkBacks



