Search
Categories
Archives

You are currently browsing the Eniaksolution.com blog archives for April, 2009.

Archive for April, 2009

This is the first tutorial on Eniaksolution.com. Hope you enjoy it!

Today, we’re going to build a small algorithm to solve (almost) all sudoku tables… The algorithm is written in C, but it can easily be converted into any other language.

The algorithm is very simple and consists in three steps:

  1. We check any single cell.
  2. If free, we check the same cell’s row, column and “square”.
  3. If  there is only one number possible, we write it in the cell and start checking the table again.

Today we will prepare the first lines of code, we constants and function prototypes. We’ll soon implement the functions’ code… So :

/* Standard library inclusions */
#include 
#include

#define FALSE 0
#define TRUE 1
#define N 9 /* Sudoku table dimension */

/*
 Author : Alessandro Piana for Eniaksolution (http://www.eniaksolution.com)
 Versione : 0.1
 Description : you can freely distribute this code, but you can't be paid for it and you should keep
 copyright infos.
*/
/* FUNCTION PROTOTIPES. ANY FUNCTION WILL BE WELL DESCRIBED LATER. */
int get_row(int);
int get_column(int);
int get_index(int,int);
void check(int indice,int mat[][N], int arr_poss[]);
void check_row(int indice,int mat[][N], int arr_poss[]);
void check_column(int indice,int mat[][N], int arr_poss[]);
void check_square(int indice,int mat[][N], int arr_poss[]);
void insert_sudoku(int mat[][N]);
void print_sudoku(int mat[][N]);
void bufferize(int mat[][N]);

PLEASE BE CAREFUL! THE LAST LINE IS WRONG! IT HAS BEEN ADDED BY THE CODE VIEWER, BUT IT SHOULD NOT EXIST!

So, see you soon for the next part!

ap

PS : Post your impressions, suggestions and anything you like!!!

Eniaksolution.com is proud to open a new section : “How to” .

How To will publish free programming tutorials about various arguments, along with free source code and free technical support…

We hope you’ll appreciate that!!!

ap

I know I’ve not published anything here since March 29th, and now I think you’d like to know that Eniaksolution is still working for you!!

At the moment, we have 2 main projects active :

  • First of all, we will be able to publish 35+free wordpress templates by May 15th!
  • Then , we’re completely renewing Culturarchitettura.com ( go here to get a small description of it)!

We’ll be back soon!!! Stay connect on Eniaksolution.com!!!

ap


‘APToolkit – The Ultimate VB6 library’ is a free and complete VB6 library immediately available and ready to use with 150+ routine, subs and functions to dramatically increase your productivity!

APToolkit – The Ultimate VB6 library includes 150+ routines and utilities divided in :

Mouse & Keyboard

VBLanguage

Tray Utilities

Graphic Sound & Multimedia

Internet Utils

Form Handling

System Integration

Array & Collections

Date,Time, Math & Conversions

Registry

Controls

PDF Class

AND MUCH MORE!!!


We’re working at the 2nd version! Send us your personal VB6 routines!

save Download APTOOLKIT HERE (447 kb, .zip file, italian doc included)
739 downloads!