Hola esta es la parte del codigo q tengo, pero igual no compila seq tiene algo mal.
#include <iostream>
#include <time.h>
#include <stdlib.h>
using namespace std;
const int Max_C = 9;
const int Max_L = 10;
void Suk_Main_Menu (int S[9][9], int, int, int, char[]);
void start(int S[9][9], int, int, int ,char[]);
void genTab ( int S[9][9]); // matrix 9*9
void displaytable ( int S[9][9], int, int, int &Free);
int fill ( int S[9][9], int l, int c); // put a number in choosen cell
int main() {
int S[Max_L][Max_C], l, c, Free;
char Name[20];
Suk_Main_Menu( S, l, c, Free,Name);
system ("PAUSE");
return 0;
}
//INITIAL MENU
void Suk_Main_Menu(int S[9][9], int l, int c, int Free, char Name[20] )
{
char option;
cout << "\n\n\n\n\n\n\t\t\t" "S.U.D.O.K.U G.A.M.E:" << endl << endl ;
cout << "\t\t\t"" Option: Press:" << endl;
cout << "\t\t\t"" NEW GAME b" << endl;
cout << "\t\t\t"" LOAD GAME l" << endl;
cout << "\t\t\t"" HELP/MANUAL h" << endl;
cout << "\n\n\t" "Choose your option:" << option;
cin >> option;
option=getchar();
switch(option)
{
case 'b' : start(S, l, c, Free, Name);
break;
/* case 'l' : open( S, l, c, Free, Name);
break;
case 'h': help( S, l, c, Free, Name);
break;
default: ("ERROR"); */
}
}
//VOID START
void start(int S[9][9], int l, int c, int Free,char Name[20]){
char s;
genTab ( S );
displaytable ( S,l,c, Free);}
//VOID SUDOKU
void genTab ( int S[9][9]) // Number of free cells
{
for (int i=0; i<9; i++)
for (int j=0; j<9; j++)
S [i][j]= 0;
}
//VOID DISPLAYTABLE (PRINT OUT THE SUDOKU TABLE 9x9)
void displaytable ( int S[9][9], int l, int c, int &Free)
{
Free = 81;
for (int i=0; i<9; i++)
for (int j = 0; j < 9; j++)
S[i][j] = j; //0 1 2 3 ... 8 in every row
//printing it like a 9*9 table, split into 3x3 blocks, like in your example
for (int i = 0; i < 9; i++)
{
for (int j = 0; j < 9; j++)
{
cout<<S[i][j]<<" ";
//every third column draw a vertical line
if ((j+1)%3 == 0)
cout<<char(219)<<" ";
}
cout<<endl;
//every third row draw a horizontal line
if ((i+1)%3 == 0)
{
for (int j = 0; j < 23; j++)
cout<<char(219);
cout<<endl;
}
for (int i = 0; i < 17; i++)
{
int x = rand()%(9-1);
int y = rand()%(9-1);
S[x][y] = rand() % 9+1;
}
}
Porfavor si alguien pudiera guiarme un poco.