Proposal for a canonical puzzle.

Programs which generate, solve, and analyze Sudoku puzzles

Re: Proposal for a canonical puzzle.

Postby yzfwsf » Tue Oct 28, 2025 2:14 am

Hi champagne:
Could you please confirm if these dlls provide stdcall exported functions for third-party calls? It would be even better if there are documents for api calls.Thank you for providing such a user-friendly feature that makes it convenient for Sudoku enthusiasts to exchange databases.
yzfwsf
 
Posts: 961
Joined: 16 April 2019

Re: Proposal for a canonical puzzle.

Postby champagne » Tue Oct 28, 2025 4:12 am

yzfwsf wrote:Hi champagne:
Could you please confirm if these dlls provide stdcall exported functions for third-party calls? It would be even better if there are documents for api calls.Thank you for providing such a user-friendly feature that makes it convenient for Sudoku enthusiasts to exchange databases.


Hi yzfwsf,

All my DLLs (in github repositories) use standard "C" calls as this one to get a band properties
Hidden Text: Show
Code: Select all
 
// ======  morphing a band
extern "C" __declspec(dllimport) void SkbGetMappingChar(   const char * a, BANDPERM *  b);
extern "C" __declspec(dllimport) void SkbGetMappingInt(   int* a, BANDPERM * b);

// ======= getting auto morphs
extern "C" __declspec(dllimport) int SkbGetAutoMorphs(int bandid, BANDPERM** tpermret);

// ======== Getting a band and  UAs of a band
extern "C" __declspec(dllimport) void SkbGetBandChar(int bandid, char* bchar27);
extern "C" __declspec(dllimport) int SkbGetUas(int bandid, int** tuas_ret);


and the intel set of instructions is required (using several native instructions).

often, an exchange structure is needed as here to get a grid in it's min lexiclcal morph
Hidden Text: Show
Code: Select all
//================ First call to get auto morphs
extern "C" __declspec(dllimport) TPGC * SkbsSetModeWithAutos();
 
TPGC *        return value for the pointer to the table

struct TPGC { char t[648][19]; int nt;BANDPERM* tpe[3];}*p_tpgc;
p_tpgc=SkbsSetModeWithAutos();


I have no API calls and I don't have the skills to do the job, but all sources are available.

==================== regarding the naming functions

This program uses several DLLs (including the virtual min lexical catalog) but this is a draft for the naming functions et I know that I have to design a DLL with the relevant calls in due time.
In my local version, I have other function needed to do some tasks of my current work on the high ratings.

I released this first draft to give to "coloin" access to the naming functions, but this can not work for potential users in LINUX.

Building a DLL can be done in 2/3 days if this becomes a priority. It should have as main call

go from a sudoku to {ED sudoku;rank;bitfield;19byte name }
go from 19 to ..
go from 25 to ...

so likely an exchange struct {ED sudoku;rank;bitfield;19byte name }

I don't see much more for a DLL.

BTW, using the DLL to build, the user must have all DLLs called here, so, all entries in these DLLs are allowed
champagne
2017 Supporter
 
Posts: 7813
Joined: 02 August 2007
Location: France Brittany

Re: Proposal for a canonical puzzle.

Postby champagne » Thu Nov 06, 2025 2:59 pm

Having no special request, I am prepared to finish the coding of the DLL with the following services

an exchange structure with all stuff used on my side

Code: Select all
struct NAMESII{
   char edp[82];// ed puz string mode
   char n25[26];// name 25 bytes string mode
   char n19[20];// name 19 bytes string mode
   char n14[15];// bitf 81 14 bytes string mode
   uint64_t rank;// sol rank 1 - 5 472 730 538 (0 no rank)
}mywi;

all "char" are strings set to null if the string is meaningless
edp is the edp puzzle 81 bytes
n25 is the name in 10 bytes for the rank, one blank, 14 bytes for the bitfield
n19 is the name in highest density
n14 is the bitfield part of the name
rank is the 64 bits value of the rank

out of the call to get the exchange area

Code: Select all
extern "C" __declspec(dllexport) NAMESII* SknameGetP();
NAMESII* SknameGetP(   ){return & mywi;}

the calls should be

Code: Select all
void SknamePuz(char* p);

any puzzle given by the user; return
  strings and rank 0 if not valid
  all exchage fields to the right value if the puzzle is valid (unique solution)


Code: Select all
void Skname25to19(char* z);
entry can be a valid n25 or rank; bitfield  return
 edp to null
 if 25 valid n25,n19,n14 rank to the expected valud.
 else rank=0; n25,n19,n14 to null


Code: Select all
void Skname19to25(char* z,int edpuz);
 entry must be a valid 19, edpuz set to 0 if the user wants only the 25 bytes field (getting the ED puzzle is expensive) return
if valid rank,n14,n19,n25 plus edp if needed
else rank=0, all strings to null


I don't see more to do in a DLL
champagne
2017 Supporter
 
Posts: 7813
Joined: 02 August 2007
Location: France Brittany

GP Puzzle labeling software

Postby coloin » Thu Nov 06, 2025 6:49 pm

Ive used your program to label puzzles very effectively as their Grid rank and puzzle pattern !
I understand the puzzle label as Grid rank : Puzzle pattern [ 10:14]

Can you explain how you have reduced this to 19 ?

And how does this DLL fit in with your previous release ?
coloin
 
Posts: 2661
Joined: 05 May 2005
Location: Devon

Re: GP Puzzle labeling software

Postby champagne » Thu Nov 06, 2025 7:56 pm

coloin wrote:Ive used your program to label puzzles very effectively as their Grid rank and puzzle pattern !
I understand the puzzle label as Grid rank : Puzzle pattern [ 10:14]

Can you explain how you have reduced this to 19 ?

And how does this DLL fit in with your previous release ?


This is not very hard.

the rank requires 33 bits.
The bit field is 81 bits

81-33=114
114/6=19

So you need 19 bytes to express 114 bits in a text file with 64 characters of the ASCII file.

This was already in the code that you used, what I do is very simple.

I keep the 30 bits of high weight of the rank as "first 5 bytes".
The 3 lower bits are sent to the 81 bits field shifted right by the 3 free bits

Doing so, I keep the possibility to use the highest bits of the rank as primary index if needed (groups of 8 consecutive solution grids)
champagne
2017 Supporter
 
Posts: 7813
Joined: 02 August 2007
Location: France Brittany

Previous

Return to Software