Sudoku v1.02 by AirConsole

N-Dream

  • Jr. Member
  • **
    • Posts: 8
    • View Profile
Hi there

I've created a 9x9 Sudoku for Thumby.

Feel free to give it a try, the script is attached. The game is in landscape mode.
When you try it in the emulator, make sure you rotate it by pasting the following in the javascript console of your browser:
Code: [Select]
(function(s){s.transform = "rotate(-90deg)";s.top="5%";})(document.getElementsByClassName("emulator_main")[0].style)
A little bit of background on how I implemented Sudoku:
It took me about 8h, it's amazing how easy it is to create games for this awesome platform. I'm used to much longer game-dev cycles with our gaming console  ;D
Anyways, generating a valid Sudoku grid actually requires quite some computational power.
In my first version, I tried to create a random Sudoku grid on the fly, but the stack size is unfortunately too small for my backtracking algorithm.
That's why I created 39 base patterns on my strong computer and added them as data to the script.
The base patterns can be flipped, rotated and group shifted in 72 ways, which give you already 2800 different Sudokus.
Together with number swapping (362'880 variations) we can generate 1'018'967'040 different Sudokus from the 39 base patterns.
All these Sudokus are "very hard to solve" and only have 25 or less clues. The data also includes the solution, which allows us to generate easier levels using clues and the solution on the fly.

I had a lot of fun implementing it and will probably create a few bigger games for Thumby.
Only wish I could already test it on real hardware. No idea how accurately the emulator is and I don't have a Thumby yet.
So anyone who already has one: Please let me know if the game works :)

Enjoy,
Andrin
(founder of AirConsole)

(EDIT: Version 1.02 Attached)
« Last Edit: October 29, 2021, 04:42:08 AM by N-Dream »


CoolieCoolster

  • Full Member
  • ***
    • Posts: 30
    • View Profile
Really great content to file size ratio and very efficiently written, though I do think it's a bit much to have an "ad" pop up every time the user wins a game. In my opinion at least, a short message on the title screen or a credits menu would be more presentable.


N-Dream

  • Jr. Member
  • **
    • Posts: 8
    • View Profile
Update 1.01:
  • Removed the Ad pop-up
  • Improved number input for user
  • Fixed tiny bug
  • Added QR-code price

The new version is attached in the original post.


N-Dream

  • Jr. Member
  • **
    • Posts: 8
    • View Profile
So I decided to give every user that solves the Sudoku on the Thumby, one week of our premium AirConsole subscription for free, cause I think it's awesome to be able to win real prizes on this lovely little pocket game device - they just need to scan the QR code that is displayed in the winning screen ;D ;D ;D


CoolieCoolster

  • Full Member
  • ***
    • Posts: 30
    • View Profile
I think the QR code is even more out of place than the ad, but each to one's own.


N-Dream

  • Jr. Member
  • **
    • Posts: 8
    • View Profile
(Changelog v1.02)
  • Fixed spelling mistake. Thanks Tarma for reporting!


 

SMF spam blocked by CleanTalk