YasSS 0.4.8
Sponsored Links
YasSS 0.4.8 Ranking & Summary
File size:
1.3 MB
Platform:
Any Platform
License:
GPL (GNU General Public License)
Price:
Downloads:
856
Date added:
2007-06-21
Publisher:
Moritz Lenz
YasSS 0.4.8 description
YasSS is a command line C++ program that solves given Sudokus.
The actual work is done in a class the encapsulates all the functionality, so it should be easy to set up another GUI for it.
How It Works
YasSS stores the Sudoku field in a two-dimensional array. For each cell there is stored which numbers can be entered there.
The actual solver is discussed below.
Header File of Class Sudoku
If a cell contains a zero, it is empty.
#ifndef _MORITZ_FIELD_
#define _MORITZ_FIELD_
#include < iostream >
// a Sudoku playing field implemented as a 2d fixed size array
// contains consistency checks and a solver.
class sudoku {
public:
sudoku();
// creates a field with in ital data. 0 means "not set".
// Note that the first coordinate is considered as x, so if
// you create an array char f= {{1 ,2 ...}, {..}} you will get
// the transposed sudoku field. but dont worry, sudoku is
// invariant under transposition
sudoku(char init_data[9][9]);
sudoku(char* init_data);
// creates a field with initial data. 0 means "not set".
// Note that the first coordinate is considered as x, so if
// you create an array char f= {{1 ,2 ...}, {..}} you will get
// the transposed sudoku field. but dont worry, sudoku is
// invariant under transposition
sudoku(int init_data[9][9]);
// generates a rather simplistic output to the given stream
// call as pretty_print(cout) or something like that...
void pretty_print(std::ostream &handle);
// just print all chars in one row
void print(std::ostream &handle);
// sets item (x, y) to val
// assumes that it is doesnt lead to an intermediate
// conflict with sudoku rules
// which is equivalent to saying it requires
// allowed_set(val, x, y) to be true
void set_item(char val, int x, int y);
// get entry at position (x, y)
// 0 means "unset"
int get_item(int x, int y);
// returns true if it doesnt lead to a direct error if you
// set (x, y) to val
// If data[x][y] != 0 the return value is
// true if val == data[x][y]
bool allowed_set(char val, int x, int y);
// try to solve the puzzle. Returns true on success.
bool solve();
// returns true if there is no zero entry left, e.g. the
// problem is solved correctly.
bool is_solved();
// returns true if there is no possibility to continue without
// violating rule
bool is_stuck();
protected:
// contains 0 for unset values and the corresponding value
// if the value is set
char data[9][9];
// allowed[x][y][i] is true if and only if it is possible to
// set data[x][y] to i+1 without conjuring an immediate
// collision.
// If data[x][y] == i != 0 then allowed[x][y][i] is true,
// allowed[x][y][j] = false for j != i
bool allowed[9][9][9];
bool simple_solve();
bool simple_solve1();
bool simple_solve2();
// returns either an is_solved or a stuck() version of *this
bool backtrack();
void null_init();
int recursion_depth;
void set_recursion_depth(int rd) {recursion_depth = rd;};
};
Enhancements:
- This release adds an option to generate Sudokus with a random number of initial clues.
The actual work is done in a class the encapsulates all the functionality, so it should be easy to set up another GUI for it.
How It Works
YasSS stores the Sudoku field in a two-dimensional array. For each cell there is stored which numbers can be entered there.
The actual solver is discussed below.
Header File of Class Sudoku
If a cell contains a zero, it is empty.
#ifndef _MORITZ_FIELD_
#define _MORITZ_FIELD_
#include < iostream >
// a Sudoku playing field implemented as a 2d fixed size array
// contains consistency checks and a solver.
class sudoku {
public:
sudoku();
// creates a field with in ital data. 0 means "not set".
// Note that the first coordinate is considered as x, so if
// you create an array char f= {{1 ,2 ...}, {..}} you will get
// the transposed sudoku field. but dont worry, sudoku is
// invariant under transposition
sudoku(char init_data[9][9]);
sudoku(char* init_data);
// creates a field with initial data. 0 means "not set".
// Note that the first coordinate is considered as x, so if
// you create an array char f= {{1 ,2 ...}, {..}} you will get
// the transposed sudoku field. but dont worry, sudoku is
// invariant under transposition
sudoku(int init_data[9][9]);
// generates a rather simplistic output to the given stream
// call as pretty_print(cout) or something like that...
void pretty_print(std::ostream &handle);
// just print all chars in one row
void print(std::ostream &handle);
// sets item (x, y) to val
// assumes that it is doesnt lead to an intermediate
// conflict with sudoku rules
// which is equivalent to saying it requires
// allowed_set(val, x, y) to be true
void set_item(char val, int x, int y);
// get entry at position (x, y)
// 0 means "unset"
int get_item(int x, int y);
// returns true if it doesnt lead to a direct error if you
// set (x, y) to val
// If data[x][y] != 0 the return value is
// true if val == data[x][y]
bool allowed_set(char val, int x, int y);
// try to solve the puzzle. Returns true on success.
bool solve();
// returns true if there is no zero entry left, e.g. the
// problem is solved correctly.
bool is_solved();
// returns true if there is no possibility to continue without
// violating rule
bool is_stuck();
protected:
// contains 0 for unset values and the corresponding value
// if the value is set
char data[9][9];
// allowed[x][y][i] is true if and only if it is possible to
// set data[x][y] to i+1 without conjuring an immediate
// collision.
// If data[x][y] == i != 0 then allowed[x][y][i] is true,
// allowed[x][y][j] = false for j != i
bool allowed[9][9][9];
bool simple_solve();
bool simple_solve1();
bool simple_solve2();
// returns either an is_solved or a stuck() version of *this
bool backtrack();
void null_init();
int recursion_depth;
void set_recursion_depth(int rd) {recursion_depth = rd;};
};
Enhancements:
- This release adds an option to generate Sudokus with a random number of initial clues.
YasSS 0.4.8 Screenshot
YasSS 0.4.8 Keywords
Bookmark YasSS 0.4.8
YasSS 0.4.8 Copyright
WareSeeker periodically updates pricing and software information of YasSS 0.4.8 full version from the publisher, so some information may be slightly out-of-date. You should confirm all information before relying on it. Software piracy is theft, Using crack, password, serial numbers, registration codes, key generators is illegal and prevent future development of YasSS 0.4.8 Edition. Download links are directly from our publisher sites, torrent files or links from rapidshare.com, yousendit.com or megaupload.com are not allowed
Featured Software
Want to place your software product here?
Please contact us for consideration.
Contact WareSeeker.com
Related Information
Related Software
NetWalk is a puzzle game where the object is to connect every terminal to the server. Free Download
BATTS provides a lean, elegant trouble ticket system with command line and Web interfaces. Free Download
GRPLib is a game library that directly supports Blizzards GRP format , which is used in StarCraft and Diablo II games. Free Download
Kats Sudoku is a simple helper program for solving Sudoku puzzles. Free Download
gtk-send-pr is a problem report tool, designed to send reports to a GNATS database server using libesmtp to deliver mail. Free Download
dbblast is a utility that automatically removes dust spots or "bunnies" from JPEG images taken with digital SLRs. Free Download
Ink is a command line tool which displays the ink level of your printer. Free Download
CAM Expert it converts drawings (DXF) to virtually any NC code / g-code. Free Download
Latest Software
Popular Software
Favourite Software