Nonograms

Hi All,

Sorry not been posting recently but Footy, Covid and Family took over. So, why am I posting now.

Very little time free over that last few weeks but - I happened across a program that someone had written that re-energised my interest. Some time ago I partially built a project which, like many got shelved, but this raised my interest level again.

The project involved nonograms (riddlers, fiddlers, picross - what ever you want to call them) - but this was a simple 10 by 10 grid. So I thought - translate to Codea (as it was written in Love2D Lua). Think again, the finished program was written in much better code than I produce, so I ended up coding in my own random way. (Basic project attached below). My aim here is to open this up to members so that we can make this into a slick piece of coding, also to offer as a starter if anyone wishes to add features to it (and there could be many) - and finally to add it to WebRepo. I have included links to the original code, which also includes a browser version for you to check out.

We may have a resident expert on this in the form of @Loopspace as there has been a lot of interest in nonogram solvers etc.

So here is the reference to the original monogram post: the Github Page

Note - although my code can’t be described as copying that of Josh Millard - aka monolifed (I only retained the same name and most of the layout) - I have included the ‘licence’ in one of the tabs - basically open for all to use but with credits. However I have dispensed with the menu page and placed buttons on the main page.

The actual function of the nonogram works but I need to build on the button features. Also, there appears to be a bug, which I have messaged @simeon about, which I think is based with an infinite loop at times (freezes the screen). I have also included a cheat mode (selected as run) which can be disabled - which allows development or cheating.

So you can sit back and play if you want, and wait for my updates, or tidy my indecipherable code (plenty of options there) or even extend the concept - some options:

Make the grid size editable
Improve the look (I do have a couple of themes to add).
Add a touch counter.
Add a file loader to load saved nonograms.

Be my guest - but please post your improvements or bug free code so we can all learn from this.

You can find Nonograms on virtually all systems, the interest is massive - just search the net to see. You can even get coloured images to play with.

The zipped file and images of my old and new nonogram projects are attached. Have fun.

All,

Not quite finished yet, latest version added as update to first post. Changes made:

Removed quit option - only put in originally as I was hoping to try to compile this as an app (learning exercise) but realised there was no way to stop a project in Codea except through the editor. Anyone know what you need for Mac closure? I assume drag off screen is inbuilt into Xcode in a library but how would you access it from Codea code?

Still a few remed out sections which will be taken out when I reach a final version.

I need to sort out the timer incorporating a pause and start. Just runs a time from project running at moment.

I have added a tap counter for the solution - I usually solve with 70 to 80 taps, not bad considering there are 100 cells. Once you get used to it it’s quite easy. May modify to a 12x12 which would make it much harder. Removed auto start for cheat mode, but can still use it. May hide access in final version with a gesture to reveal.

I love these! Tried it out and the 10x10 is quite hard. Are they randomly generated?

@Simeon - uses random seed to generate, but at 10x10 you do see common line patterns. I’m going to expand it probably to 12x12 and 14x14 with a selector so you can build up. Once you learn the ‘rules’ you can get reasonable counts. Think my lowest on this was 64 taps. Worst lines are the few blocks in short lengths. Thanks for the post.