Page 2 of 2

Fill the grid

Posted: Fri Sep 29, 2017 7:46 pm
by Henrick
spot;1512909 wrote: I thought I'd bump the thread to keep it current, I've managed to get a couple of hours more coding and it looks more interesting after each session. I've never tried implementing anything like this as a bash script before, it's eye-opening. Whether it's efficient is anyone's guess.


Thank you! I'll generate another puzzle later tonight or tomorrow.

Here is the latest puzzle. This one is actually easy (well, I think it is)

By the way, how do we get this thread to be at the top so that I don't keep it going by always replying to your solutions?

I am not very familiar with the workings of this forum. I would lilke to be able to have each puzzle as the start of a new thread. It would be great if you could provide me with instructions on how to do this.

Attached files

Fill the grid

Posted: Sat Sep 30, 2017 12:44 am
by spot
You could keep bookmark or favorite links to the bits of ForumGarden you want to get to regularly. I keep the browser bookmark toolbar on screen and store the links on that, but you could pin the links to your taskbar or drop them on your desktop if that's more natural for you.

This link starts a new Word Game thread if you want to have a different thread for each new puzzle:

http://www.forumgarden.com/forums/newth ... read&f=151

This opens your "Fill the grid" thread to see the latest posts:

http://www.forumgarden.com/forums/word- ... ost1512912

This makes a new post into "Fill the grid":

http://www.forumgarden.com/forums/newre ... &noquote=1

I also have these on my bookmark toolbar:

Search Results - ForumGarden to list all the threads active in the last 24 hours

http://www.forumgarden.com/forums/subscription.php to list all the threads I've been active in

http://www.forumgarden.com/forums/onlin ... 200&page=1 to see which members have been active most recently - I'm not sure what it will show you but you could try it.

If you drag these to somewhere accessible they might make access quicker.

Fill the grid

Posted: Sun Oct 01, 2017 11:37 am
by spot
I managed to code for several hours and all the design is now covered but there's a frustrating error I've not combed out. I'll drop my debug results here because I'm away until Tuesday and it will be an incentive to clear it up if I've posted the problem in public.

parameters:2:fb:rh

cut: invalid byte/character position 'rh'

Try 'cut --help' for more information.

parameters:2:fb:rh

cut: invalid byte/character position 'rh'

Try 'cut --help' for more information.

parameters:3:[dglnprstv][aeiou][v]:1

parameters:3:[dglnprstv][aeiou][v]:2

parameters:3:[dglnprstv][aeiou][v]:3

parameters:3:[abceghiklmnoprstuwx][a]:1

parameters:3:[abceghiklmnoprstuwx][a]:2

parameters:3:[abceghiklmnoprstuwx][a]:3

parameters:2:[abcdefhijklmnoprstz][nr]:1

parameters:2:[abcdefhijklmnoprstz][nr]:2

parameters:3:[d][aeorsuz][e]:1

parameters:3:[d][aeorsuz][e]:2

parameters:3:[d][aeorsuz][e]:3

parameters:7:[s][o][g][r][v]:1

parameters:7:[s][o][g][r][v]:2

parameters:7:[s][o][g][r][v]:3

parameters:7:[s][o][g][r][v]:4

parameters:7:[s][o][g][r][v]:5

parameters:7:[s][o][g][r][v]:6

parameters:7:[s][o][g][r][v]:7

parameters:5:[acehikmopsty][eglmrwx][iou][y][acdelnprstx]:1

parameters:5:[acehikmopsty][eglmrwx][iou][y][acdelnprstx]:2

parameters:5:[acehikmopsty][eglmrwx][iou][y][acdelnprstx]:3

parameters:5:[acehikmopsty][eglmrwx][iou][y][acdelnprstx]:4

parameters:5:[acehikmopsty][eglmrwx][iou][y][acdelnprstx]:5

parameters:5:[cegimps][aceghiklmnorstuy][dglnprstv]:1

parameters:5:[cegimps][aceghiklmnorstuy][dglnprstv]:2

parameters:5:[cegimps][aceghiklmnorstuy][dglnprstv]:3

parameters:5:[cegimps][aceghiklmnorstuy][dglnprstv]:4

parameters:5:[cegimps][aceghiklmnorstuy][dglnprstv]:5



What I think is that there are sometimes null fields where there should be lists of letters, which is incidentally feeding bad input to the "cut" command. If I can find what's losing my letter strings I'll be back on track.

Those parameters are the number of letter strings I ought to be showing, then the strings in square brackets, then the offset I propose to process. A couple of lines have lost their square brackets and some of the expected strings are absent.

As for the current game, I know one of the words. Fosse, a moat, a ditch dug to hinder entry. The rest I have managed to avoid during a long and otherwise inquiring life.

Attached files

Fill the grid

Posted: Sun Oct 01, 2017 5:26 pm
by Henrick
spot;1512927 wrote: I managed to code for several hours and all the design is now covered but there's a frustrating error I've not combed out. I'll drop my debug results here because I'm away until Tuesday and it will be an incentive to clear it up if I've posted the problem in public.

parameters:2:fb:rh

cut: invalid byte/character position 'rh'

Try 'cut --help' for more information.

parameters:2:fb:rh

cut: invalid byte/character position 'rh'

Try 'cut --help' for more information.

parameters:3:[dglnprstv][aeiou][v]:1

parameters:3:[dglnprstv][aeiou][v]:2

parameters:3:[dglnprstv][aeiou][v]:3

parameters:3:[abceghiklmnoprstuwx][a]:1

parameters:3:[abceghiklmnoprstuwx][a]:2

parameters:3:[abceghiklmnoprstuwx][a]:3

parameters:2:[abcdefhijklmnoprstz][nr]:1

parameters:2:[abcdefhijklmnoprstz][nr]:2

parameters:3:[d][aeorsuz][e]:1

parameters:3:[d][aeorsuz][e]:2

parameters:3:[d][aeorsuz][e]:3

parameters:7:[s][o][g][r][v]:1

parameters:7:[s][o][g][r][v]:2

parameters:7:[s][o][g][r][v]:3

parameters:7:[s][o][g][r][v]:4

parameters:7:[s][o][g][r][v]:5

parameters:7:[s][o][g][r][v]:6

parameters:7:[s][o][g][r][v]:7

parameters:5:[acehikmopsty][eglmrwx][iou][y][acdelnprstx]:1

parameters:5:[acehikmopsty][eglmrwx][iou][y][acdelnprstx]:2

parameters:5:[acehikmopsty][eglmrwx][iou][y][acdelnprstx]:3

parameters:5:[acehikmopsty][eglmrwx][iou][y][acdelnprstx]:4

parameters:5:[acehikmopsty][eglmrwx][iou][y][acdelnprstx]:5

parameters:5:[cegimps][aceghiklmnorstuy][dglnprstv]:1

parameters:5:[cegimps][aceghiklmnorstuy][dglnprstv]:2

parameters:5:[cegimps][aceghiklmnorstuy][dglnprstv]:3

parameters:5:[cegimps][aceghiklmnorstuy][dglnprstv]:4

parameters:5:[cegimps][aceghiklmnorstuy][dglnprstv]:5



What I think is that there are sometimes null fields where there should be lists of letters, which is incidentally feeding bad input to the "cut" command. If I can find what's losing my letter strings I'll be back on track.

Those parameters are the number of letter strings I ought to be showing, then the strings in square brackets, then the offset I propose to process. A couple of lines have lost their square brackets and some of the expected strings are absent.

As for the current game, I know one of the words. Fosse, a moat, a ditch dug to hinder entry. The rest I have managed to avoid during a long and otherwise inquiring life.


Congratulations Spot! And yes, Fosse is from the french word "Fossé" (a ditch) or the word without accent "Fosse" (a pit)

I am also posting today's puzzle. Good luck!

Attached files

Fill the grid

Posted: Mon Oct 02, 2017 8:59 am
by spot
I have the solver working. It needs a wrapper to turn it into a game creator to search for grids with unique solutions, but it solves games which have been set.

$ time sld grid-f

grid-f has 20 clues in 7 columns by 7 rows

initial grid

..u....

..n..o.

.......

.......

..v.d..

......v

.......

final grid

.gulag.

monolog

ods.aba

od...in

lev.doe

isogriv

.sloyd.

real 0m9.171s

user 0m5.835s

sys 0m2.615s

$ time sld grid-h

grid-h has 6 clues in 5 columns by 5 rows

initial grid

h..w.

....k

.o...

.....

z.u..

final grid

halwa

a.a.k

fosse

i.s.e

zouks

real 0m1.503s

user 0m0.939s

sys 0m0.410s

$ time sld grid-i

grid-i has 9 clues in 5 columns by 4 rows

initial grid

....v

...r.

.....

.q...

final grid

schav

tiara

inkle

eques

real 0m4.128s

user 0m2.845s

sys 0m0.888s





The code for the three scripts is at (5 lines), (10 lines) and (140 lines).



added later: I was always taught if you want to optimize code, don't, and if you still want to optimize code, do it after everything's working. I just made a 2-line change to slc and cut the run times to a third (by using single-length word lists instead of creating them on the fly each time).

I could probably cut it in half again by making a temporary store of the list of possible words for each clue and repeatedly using that store to extract the new unique sorted letters for each offset. At the moment I generate the list multiple times. I'll keep that in mind when I add the create-a-game wrapper if run times start getting uncomfortably high.

Fill the grid

Posted: Tue Oct 03, 2017 3:41 am
by spot
I've started looking at how to create games with a wrapper, and so far I've got

grid-n has 10 clues in 7 columns by 3 rows

initial grid

. b . s . . d

. . . . . f o

. . . y . . .

final grid

a b a s h e d

t a r t u f o

s t e y e s t

real 0m0.696s



but I'll have to sit back over a coffee to try to see how to select the right starting conditions to reach a unique solution. It's a puzzle.