My Sudoku is in Beta mode

The game is now queued into the depot, but here it is for your use.

Download Page

There is a win32 binary and source code. If someone would like to create another version for me that would be great. I don't know how to create so's in Linux.

The language selection is still manual. You have to edit the ini file after you play the game the first time. I will make it apart of the options menu, but I forgot. Also , the game needs the language files updated with the new text. Which I cannot do myself.

I also forgot to add instructions to the game. I just realized that.

Short instructions: Put 1-9 into each row, column, and 3x3 square.

There are only two themes to choose from atm. One is a copy of the other, but with different color scheme. I needed at least two to work on the theme choose menu.

Please try it out and let me know of any bugs. I tried to find them all, but no program is bug-free.

(If you would like to finish a language file, send it to me either email or pm and I will get it into the zip file)


Very well done! :)
I'm not much of a sudoku player, but that may change.. I've been meaning to get into it.

I noticed that you need these DLL files, though:

The files I linked to were taken off and I have no idea of their validity, but they worked for me. :)


I don't know how to create so's in Linux.

But I told you once already! Here's the generic makefile I use for compiling plugins for AMGC2:

1ifdef MINGDIR
2 CC = g++
3 FLAGS = -shared -Wl,--enable-auto-import -Wl,--enable-runtime-pseudo-reloc -s -W -Wall -I../../src/
4 LIBS = -lalleg
5 EXT = dll
7 CC = g++
8 FLAGS = -shared -s -fPIC -W -Wall -I../../src/
9 LIBS = `allegro-config --libs`
10 EXT = so
13src = game.cpp
15all: $(src)
16 $(CC) -o game.$(EXT) $(src) $(FLAGS) $(LIBS)

In short: gcc -o some.c -shared -fPIC


A big thanks to miran for helping me out on that so problem. Miran, to let you know that I just needed to add the extern "C". When I messed with the path like you posted on the other post, I just kept getting errors. So I put it back to how I had it.

I got a Linux verison working on my machine, I would like to know if it will work on others. It's huge, 1.5Meg, because of static linking.

Web Page

If it doesn't work then please post the error codes.


It works. But there are a few problems:

1. Any screen resolution other than 640x480 doesn't work. The game exits immediately without saying anything. It does that both if I change the resolution in-game and if I manually edit the ini file.

2. Language files don't work properly. That's because you use U_ASCII when in order to properly support more than a handfull of languages you should use U_UTF8 or something similar. Attached is a new Slovenian text file encoded with UTF-8. Btw, the extension should probably be si instead of sl.

3. The user interface is a bit laggy. Sometimes the mouse cursor gets stuck in one place for a fraction of a second and sometimes I have to click a button two or three times before it reacts. Could be a generic problem that Allegro programs have on Linux. I notice some other games too like to stutter once every few seconds.

4. I assume the binary is 32bit. While it works, I'd much rather have the full source (including headers and the generator and themes source) so I could compile my own 64bit version. Might solve problem #3.

EDIT: Regarding the international language support. I noticed that the themes have two fonts for printing text: large and small. The small one is good, it has 480 glyphs which include all the glyphs required by all European languages that use latin script. But the large font only has something like 224 glyphs and is missing many characters, including those required to display Slovenian text.

Btw, I noticed you do use U_UTF8 in game.cpp but perhaps you're manipulating strings with functions that are not unicode aware? You should always use Allegro's string functions, the ones prepended with a 'u'.

EDIT2: I did a little test. Loaded a string from a UTF-8 encoded file and displayed with your fonts. It turns out I had to call uconvert before it worked:

uconvert(stringFromTextFile, U_UTF8, stringForPrinting, U_ASCII, BUFFER_SIZE);


Can you show me how to load and convert a string from file?

uconvert(stringFromTextFile, U_UTF8, stringForPrinting, U_ASCII, BUFFER_SIZE);

Won't this convert a U_UTF8 to U_ASCII, which I don't want? Or do I?

Here is my get_string function. I needed to be able to process "\\","\n" into '\\','\n'. Any help would be appreciated.

1char *get_string( PACKFILE *pfile, char *string, int len )
3 int index = 0;
4 int c = '\0';
6 for ( int i = 0; i < len; i++ )
7 {
8 string[ i ] = '\0';
9 }
11 if ( !pfile )
12 {
13 return string;
14 }
16 while ( true )
17 {
18 c = pack_getc( pfile );
20 if ( c == '\r' )
21 {
22 c = pack_getc( pfile );
23 }
25 if ( c == EOF || c == '\n' )
26 {
27 break;
28 }
30 if ( c == '\\' )
31 {
32 c = pack_getc( pfile );
33 switch ( c )
34 {
35 case 'n':
36 {
37 c = '\n';
38 } break;
39 case '\\':
40 {
41 c = '\\';
42 } break;
43 }
44 }
46 string[ index++ ] = c;
47 }
49 if ( need_uconvert( string, U_UTF8, U_CURRENT ) )
50 {
51 char stringBuffer[ 1024 ] = "";
52 uconvert( string, U_UTF8, stringBuffer, U_CURRENT, sizeof( stringBuffer ) );
53 ustrcpy( string, stringBuffer );
54 }
56 return string;


Can you show me how to load and convert a string from file?

My entire test program pasted below. Reads one line from and prints it with both fonts from the theme dat files. Works as expected when the text file is UTF-8 encoded as long as required glyphs are found in the font.

1#include <allegro.h>
3int main() {
4 set_uformat(U_UTF8);
5 allegro_init();
6 set_color_depth(32);
7 set_gfx_mode(GFX_AUTODETECT_WINDOWED, 640,480,0,0);
8 install_keyboard();
9 FONT *f1 = load_font("textMenu.pcx", 0, 0);
10 FONT *f2 = load_font("text12.pcx", 0, 0);
11 PACKFILE *file = pack_fopen("", "r");
12 char buf[256];
13 pack_fgets(buf, 256, file);
14 char testString[256];
15 uconvert(buf, U_UTF8, testString, U_ASCII, 256);
16 pack_fclose(file);
17 textprintf_centre_ex(screen, f1, SCREEN_W/2, SCREEN_H/2 - text_height(f1), -1, -1, testString);
18 textprintf_centre_ex(screen, f2, SCREEN_W/2, SCREEN_H/2 + text_height(f2), -1, -1, testString);
19 destroy_font(f1);
20 destroy_font(f2);
21 readkey();


Won't this convert a U_UTF8 to U_ASCII, which I don't want? Or do I?

It's confusing, I don't get it either, but it works.


Attached is what I have currently for the source. I also assume that the binary is 32bit. :) I have no idea.

However, I haven't done anything with the text routines. I changed the fonts to contain 480 glyphs each. Only the win32 binary has the new datafiles.

As for the graphics mode. When a mode is requested, the old one is saved. If the new one doesn't work then the old one is put back. I'll look into that. I didn't test that when I was running Linux. I have to reboot to check/test/fix it.

Thread #585619. Printed from