jonadsimon / wonder-words-generator

Generates WonderWords puzzles
Apache License 2.0
2 stars 0 forks source link

Introduce more stochasticity by shuffling pivots #69

Closed jonadsimon closed 2 years ago

jonadsimon commented 2 years ago

In addition to shuffling word order, can shuffle pivot-positions by ±1 with each board redraw. Increases the chance that a good board will be stumbled upon

jonadsimon commented 2 years ago

Even better: add this jiggling as a tunable parameter within the model. That is, add an additional {-1,0,1} "jiggle" array that can shift the pivot slightly, so the optimization itself can decide where to place things.

In a similar, parallel vein, can group together all of the words of a given length and try to let the algo select the locations for all of them simultaneously, rather than permuting them upon feed-in.

jonadsimon commented 2 years ago

No... shuffling in-code doesn't make sense since if it's sliding the words across the board on their main axis already then this is already happening. CAN add it as an input parameter by shuffling words around their center point.

Lenth 7: xxxOxxx | xxOxxxx | xxxxOxx Lenth 6: xxOxxx | xxxOxx Lenth 5: xxOxx | xOxxx | xxxOx Lenth 4: xOxx | xxOx

Or maybe just jiggle the even-length ones since (1) those are prevalent, (2) it's ill-defined what their "center" is

jonadsimon commented 2 years ago

Allowed jiggle-factor, as measures by dist-from-center: 4: -0.5,+0.5 --> 0.5/4 = 0.125 5: 0 --> 0/5 = 0 (1/5=0.2 DISALLOWED) 6: -0.5,+0.5 --> 0.83 7: -1,0,+1 --> 1/7 = 0.143 8: -1.5,-0.5,+0.5,+1.5 --> 1.5/8 = 0.1875

Ans: jiggle-factor must be <0.2 from center-point

jonadsimon commented 2 years ago

Worked well, added in https://github.com/jonadsimon/wonder-words-generator/commit/be545e1497b8b697a427c83eff615f5ae636374f

However previously-added max_freq optimizer is better on average