Sudoku on ZX Spectrum 48K

edited August 2008 in Games
ZX Spectrum 48К Sudoku game
25 years Spectrum and
300 years Leonhard Euler anniversary.

6000 (and more) puzzles, 8 levels.

http://www.tangram.rs/sudoku/

Sudoku2007c.gif
Post edited by srba on
«1

Comments

  • edited June 2008
    Cool, thanks. :) I'll take a look at that when I've got more time.
  • LCDLCD
    edited June 2008
    I like sudoku and this version is simply great. It works only in 48K mode. Any instruction?
  • edited June 2008
    I'm the author. My english is bad and there is no instruction on english. Only on Serbian. But, any suggestion...
  • edited June 2008
    Cursor keys (CAPS SHIFT + 5,6,7,8) or QAOP moves cursor
    Digits 1-9 enters value in box
    0 or DELETE (CAPS SHIFT + 0) erase value
    Capital letters on MENU execute commands
    H - Hint
    F - auto Fill
    U - Undo last enter
    R - Redo last Undo
    M - Mark value
    B - take Back to last marked value (manual recursion :-)
    G - new Game
    D - Done (resign) current game
    L - Load new 1000 puzzles (not implemented yet fully)
    J - ditto
    E - Exit to OS

    On top
    P=XXX (puzzle number from 0 to 999)
    L=X (level from 0 to 7)
    TXX:XX;XX or
    TXX:XX:XX time
  • LCDLCD
    edited June 2008
    Thanks! Just one thing: these Red/Blue numbers, I guess this is autohint (Sorry, can't check it at moment carefully because I'm now on my linux machine), but why two lines?
  • edited June 2008
    Red is HINT for RED digits (global) and you may enter in boxes only this digits
    Blue is HINT for BLUE (and RED) digits, actually HINT for partially solved puzzle
  • edited June 2008
    Hint and Fill calculate onlu NakedHint (Single Solution) and Scanning (SingleCell) hint
  • ZupZup
    edited June 2008
    OMFG!!!

    I was proud that Speccys didn't have anykind of sudoku program!!! What's next? The Sims for Spectrum?
    I was there, too
    An' you know what they said?
    Well, some of it was true!
  • edited June 2008
    Zup wrote: »
    I was proud that Speccys didn't have anykind of sudoku program!!!

    This one ain't the first Spectrum sudoku:
    http://www.bytemaniacos.com/html/basic2005.html
  • edited June 2008
    Also, there is Gavin Callard's Speccy Sudoku solver, submitted to CSSCGC 2008 (near the bottom of this page).

    http://reptonix.awardspace.co.uk/sinclair/csscgc2008/games2.htm

    It's great to watch this in action, particularly the compiled version runing in an ultra-fast emulator like JPP!
  • edited June 2008
    On serbian cyrillic:

    Е какве сте ви тупаџије. Има разних програма, али овакав нема. Уме да реши сваку судоку слагалицу и има 1000 слагалица у 27000 бајтова. Као није то ништа, видели смо и боље. За то срби кажу: "У туђега татка поголема патка."
  • edited June 2008
    OK so where do we get the file to run it outside of that web page?
  • edited June 2008
    Vertigo wrote: »
    OK so where do we get the file to run it outside of that web page?

    Just click on the screen at the top of the page, and a menu will appear on rge next page, saying:

    1x 2x TZX Forums

    Just select "TZX" and the game will download.
  • edited June 2008
    Sudoku Solver is only BRUT-FORCE solver and works fine with simple puzzles but never ends for difficult puzzles (or no end for life of programer).

    Just try to solve puzzle no 875 from ZX Sudoku program...
  • edited June 2008
    srba wrote: »
    Sudoku Solver is only BRUT-FORCE solver and works fine with simple puzzles but never ends for difficult puzzles (or no end for life of programer).

    Just try to solve puzzle no 875 from ZX Sudoku program...

    Um - a brute force solver will find the (first) valid solution for all legal puzzles. It just takes a while. It won't fail, unless the puzzle given to it does not conform to the rules. (The version on the CSSCGC site will crash eventually if given a puzzle that cannot be solved. I have an updated version here that knows when it it cannot solve and reports that the puzzle is not legal...eventually!)

    By the way, it solved puzzle 875 in 34 minutes and 23 seconds. :D
  • edited June 2008
    00:34:23 :)
    On real Spectrum 34y and 23 days

    You must improve program with SingleSolution and SingleCell search.
  • edited June 2008
    BTW: Congratulations to Spain Euro 2008 football win...
  • edited June 2008
    srba wrote: »
    00:34:23 :)
    On real Spectrum 34y and 23 days

    You must improve program with SingleSolution and SingleCell search.

    Actually, that WAS on a real Spectrum. Try it for yourself!

    (That is using the compiled version - I suspect the BASIC version will take an ugly amount of time!)


    EDIT: Forgot to mention this:

    Love your program by the way - both the game and the scrolling message! ;)
  • edited June 2008
    In Sudoku 2007 every of 1000 puzzles have 9! = 362880 permutations and program have actually 1000 * 9! = 362,880,000 different puzzles.

    One permutation of puzzle 825 is
    http://www.menneske.no/sudoku/eng/showpuzzle.html?number=5997067

    My testing permutation is:

    520008490 526318497
    307005108 347965128
    000000306 189427356
    410000200 418753269
    000040000 965142783
    002000014 732689514
    603000070 653294871
    801500002 871536942
    094800035 294871635

    Sudoku is simple "GAME" and may be solved with few (max 3 or 4) recursions. Of course, after SiSo and SC scans.
  • edited June 2008
    Zup wrote: »
    OMFG!!!

    I was proud that Speccys didn't have anykind of sudoku program!!! What's next? The Sims for Spectrum?

    You've obviously never heard of Little Computer People.
  • edited June 2008
    Well, using Spectaculator (I have to go to sleep soon, so using a real spectrum was no good this time) I ran the puzzle you linked to in your previous post in both version 9 (BASIC) and version 9 (Compiled BASIC). (this one http://www.menneske.no/sudoku/eng/showpuzzle.html?number=5997067)

    If there is another puzzle you'd like to test, let me know!

    The solutions took 02:30:33 in BASIC (that's hours, minutes and seconds) and 00:06:11 in the compiled BASIC.

    The program works. Inelegant as it is, seems to me it is (sadly) fit for purpose. To think I submitted it as a CSSCGC entry...it works too well for that!

    Moving on - you mention some other algorithms - I'm not a mathematician, but that sounds interesting. Would you care to share ideas?
  • edited July 2008
    Small updates in program. Srba.
  • edited July 2008
    gcallard wrote: »
    The solutions took 02:30:33 in BASIC (that's hours, minutes and seconds) and 00:06:11 in the compiled BASIC.

    I'm currently play-testing a new version of Sudoku that Kev. Thacker is writing, which includes a solver which managed that grid in 6 seconds flat. :-o
  • edited July 2008
    Site http://netbet.rs/sudoku/ updated

    There is HOW 2 PACK puzzle in 27bytes.
  • edited July 2008
    bobs wrote: »
    I'm currently play-testing a new version of Sudoku that Kev. Thacker is writing, which includes a solver which managed that grid in 6 seconds flat. :-o

    OK. You WIN. Give me or POST at http://netbet.rs/ this
    "new version of Sudoku that Kev. Thacker is writing".

    Thanks in advance...
  • edited July 2008
    bobs wrote: »
    I'm currently play-testing a new version of Sudoku that Kev. Thacker is writing, which includes a solver which managed that grid in 6 seconds flat. :-o

    OK, that's quick! Presumably doing something clever unlike my brute force bodge? :smile:
  • edited July 2008
    Don't forget the 1K Sudoku from the 2005 Minigamecompo

    http://www.cs.utexas.edu/users/otto/spectrum/spectrum.html
  • edited July 2008
    srba wrote: »
    OK. You WIN. Give me or POST at http://netbet.rs/ this
    "new version of Sudoku that Kev. Thacker is writing".

    Thanks in advance...

    My website is here:
    www.kjthacker.f2s.com/games/index.html

    The game is a dual development for Amstrad CPC and Spectrum.

    At first the Amstrad CPC version was the lead platform, then it became the Spectrum version and again the Amstrad is now the lead platform. I am hoping to finish it soon, I am fixing last minute bugs and I need to add one feature. When the Amstrad version is done, I will fix the Spectrum version and a demo will then be uploaded to my site.

    The full version will be available through Cronosoft.

    The demo version for the Amstrad version can be downloaded from that website if you want to try that first to get an idea of what the Spectrum version will be like.

    The full version includes:
    - enter your own grids and play those
    - enter a grid for it to solve
    - more levels.

    Info:
    - Yes it took 6 seconds to solve that grid and that was brute force. Solver is pure z80 code.
    - Each level takes 2 bytes. I am not joking.
    - play 4x4, 6x6, 8x8, 10x10 and 12x12 grids.
    - great music (4 tunes)
    - two modes of entering numbers.
    - nice graphics

    Please be patient for the final release.
  • edited July 2008
    New 1000 puzzles added to program.
  • edited July 2008
    kevthacker wrote: »
    My website is here:
    www.kjthacker.f2s.com/games/index.html
    Info:
    - Yes it took 6 seconds to solve that grid and that was brute force. Solver is pure z80 code.
    Please be patient for the final release.

    Aha...z80 vs. compiled basic! Nice! I am genuinely curious how similar your brute force algorithm is to the one I used. Just curious - I kinda ran with a "check for illegal lines" then columns, then current 1/9 square approach (actually, the first version wasn't even that smart - it did all 1/9 squares). From there it was just iterative.

    I'll look forward to seeing it, and also trying the new stuff on srba's game too. :)
Sign In or Register to comment.