Welcome guys..

This is programmer sharing his collection with all you ppl out there. This blog contains complete codes of java , c , c++ , unix , java script , applets , swing for learning purpose only. I try to add approx 10 new complete codes daily. Lets share out knowledge and materials in here. All your comments and votes are most welcomed.

Get your codes from..

Thursday, May 8, 2008

Sudoku Puzzle Generator (C)

#include
#include
#include
#define LINUX //COMMENT THIS LINE IF YOU ARE PROGRAMMING IN MS WINDOWS
ENV
(TC)
#ifndef LINUX
#include
#endif

int check_this_in_a_col(int matrix[9][9],int col,int maxindex,int
element);
int is_this_in_3by3cell(int value,int filled[9]);
void initialise_filled_to_0(int filled[9]);
int make_a_new_cell(int matrix[9][9],int rl,int rh,int cl,int ch,int
how2check);
int find_dup(int matrix[9][9],int i,int j,int array[9]);
int check_cell(int matrix[9][9],int rl,int rh,int cl,int ch);
void actual_thing_from_matrix(int matrix[9][9],int level);
void print_it(int mat[9][9],int to_file);
void print_both(int mat[9][9],int result[9][9],int to_file);
void sudoku(int mat[9][9],int filled[9]);

int main()
{

int filled[9],matrix[9][9],what2do;
#ifndef LINUX
clrscr();
#else

printf("

No comments:

Project Source Codes