Join us on Discord!
You can help CodeWalrus stay online by donating here.

Sudoku CSE [ASM] [CSE]

Started by unknownloner, June 11, 2015, 09:41:52 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

unknownloner

There's already sudoku games out there for the CSE, but I felt like making one in assembly for funs, as a quick break from doing stuff with my


Anyways, I've got some code from an old attempt I might re-use, not sure yet, but right now I'm just generating puzzles.
I wrote a puzzle generator in haskell to see if I could do it, and it works pretty well, so I'm letting that run for a bit.

As much as I'd like to generate puzzles on the CSE, it turns out proper puzzle generation can be a bit processor heavy. Instead, I'm going to focus on making the core of the game small/lightweight, and then (if I have enough puzzles) release a few packs as either different programs, or a collection of appvars. Really it just depends on how compressible the puzzle data ends up being.

Screenshots tomorrow maybe if I get any coding done. And by tomorrow I mean today, I'm going to sleep right now @ 6 A.M.

  
/)

Snektron

Oh cool :) also the isometric renderer looks really cool too :)
  • Calculators owned: TI-84+
Legends say if you spam more than DJ Omnimaga, you will become a walrus...


Unicorn

Yay sudoku! I suggest AppVars for storage though.
  • Calculators owned: I own all of them: PICKACHUP TI 84+ CSE TI 83+ SE TI something something ??? ??? ??? ??? ???
  • Consoles, mobile devices and vintage computers owned: PICKACHUP ??? ??? ??? ??? ???



??? ??? ??? ??? ???

unknownloner

Problem with appvars is it makes loading way more complicated, especially if they can be archived.

  
/)

alexgt

Cool, :) the CSE or CE is my next calc ;)

Also the Isometric renderer looks awesome :)
  • Calculators owned: Ti-84+, Ti-Nspire, Hp Prime, Broken HP Prime, HP 48SX

Dream of Omnimaga

You could maybe include some pre-made puzzles if speed is too much of an issue. I would like to see Sudoku on the CSE. That isometric tilemapper also looks nice. :)
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

unknownloner

I've generated 6750 puzzles so far and counting :P

  
/)

Dream of Omnimaga

Wow, that's nice then. :)
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

Unicorn

How does? huh?

Unicorn is not smart enough O.O
  • Calculators owned: I own all of them: PICKACHUP TI 84+ CSE TI 83+ SE TI something something ??? ??? ??? ??? ???
  • Consoles, mobile devices and vintage computers owned: PICKACHUP ??? ??? ??? ??? ???



??? ??? ??? ??? ???

Snektron

Well, that means there are enough puzzles to solve
  • Calculators owned: TI-84+
Legends say if you spam more than DJ Omnimaga, you will become a walrus...


Unicorn

Ha, no kidding. If someone solves them all, they should get a badge :P
  • Calculators owned: I own all of them: PICKACHUP TI 84+ CSE TI 83+ SE TI something something ??? ??? ??? ??? ???
  • Consoles, mobile devices and vintage computers owned: PICKACHUP ??? ??? ??? ??? ???



??? ??? ??? ??? ???

unknownloner

#11
Alright so some math stats

I did some tests on the puzzles I have right now. They're all what I'd classify under "hard" or "very hard" difficulties right now, but don't worry I'll be converting many to easier puzzles.
Anyhow, given my current set of 8321 puzzles:
These puzzles have on average 24-25 starting numbers. The rest are all zeroes.
I can compress them down to, on average, 22.32 bytes per puzzle.
That means that in 4096 bytes I could store about 188 puzzles.
Realistically it will be less because easier puzzles will take more space, but this is pretty good when you consider a full board is 81 numbers. I'll have quite a few puzzles included and I might not need separate puzzle packs for them.

EDIT:
Oh and the way I'm compressing them is I'm storing them as a series of bits.
To store an empty tile, I have a 0 bit.
To store a non-empty tile I have a 1 bit, followed by 4 bits representing the tile's number.
Pretty simple really.

  
/)

Snektron

Thats quite a cool compression algo O.O
  • Calculators owned: TI-84+
Legends say if you spam more than DJ Omnimaga, you will become a walrus...


alexgt

Quote from: unknownloner on June 12, 2015, 09:03:58 AM
Alright so some math stats

I did some tests on the puzzles I have right now. They're all what I'd classify under "hard" or "very hard" difficulties right now, but don't worry I'll be converting many to easier puzzles.
Anyhow, given my current set of 8321 puzzles:
These puzzles have on average 24-25 starting numbers. The rest are all zeroes.
I can compress them down to, on average, 22.32 bytes per puzzle.
That means that in 4096 bytes I could store about 188 puzzles.
Realistically it will be less because easier puzzles will take more space, but this is pretty good when you consider a full board is 81 numbers. I'll have quite a few puzzles included and I might not need separate puzzle packs for them.

EDIT:
Oh and the way I'm compressing them is I'm storing them as a series of bits.
To store an empty tile, I have a 0 bit.
To store a non-empty tile I have a 1 bit, followed by 4 bits representing the tile's number.
Pretty simple really.
"hard or "very hard" O.O (I don't even know  how to play Sudoku :P)
  • Calculators owned: Ti-84+, Ti-Nspire, Hp Prime, Broken HP Prime, HP 48SX

Duke "Tape" Eiyeron

Why not just RLE? If many of the puzzles will be full of zeros, RLE would do a very good work on it.
  • Calculators owned: A lot.

Powered by EzPortal