Re: ANN: BoggleSolver now on sample stacks

2022-01-02 Thread J. Landman Gay via use-livecode

On 1/2/22 5:42 PM, Alex Tweedly via use-livecode wrote:
1. given we have 25 grid positions, and 25 letters (omitting 'Q'), what arrangement of letters 
gives the most, or least, words.


A decade ago I found this board on the net somewhere, it claims to have a possible 3271 points 
(didn't say how many words.) Good luck:


RSTCS
DEIAE
GNLRP
EATES
MSSID

Your solver finds 1786 words.

--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: ANN: BoggleSolver now on sample stacks

2022-01-02 Thread J. Landman Gay via use-livecode
This is fantastic! I've often wondered how many possible words there are in any given grid. The 
web interface is much better than the last time I tried one, very speedy response after the 
initial load. And even that is much better than it used to be.


I'll grab the stack next. Cool.


On 1/2/22 5:42 PM, Alex Tweedly via use-livecode wrote:

I've put a little 'game' up on "sample stacks", and also on the web.

It "solves" Boggle style puzzles, i.e. you give it a 5x5 grid of letters, and it finds all 
words within it, following the prescribed rules - words are formed by moving to adjacent 
(including diagonal) grid positions, and you cannot re-use a grid position within a word. You 
can modify the input field, and click on "Solve it" to see the new results.


The list of words is that used by Jacqueline in her JQBoggle game.

The UI is very basic - but there is one clever (I think) thing within it. It uses a dictionary 
of words which is a hierarchical character-by-character array, so it represents not only "what 
is a word" but also "what can be the initial substring of a word", and therefore it can prune 
the search tree immediately. This takes the time to solve a puzzle down from approx 10 - 50 
minutes using a simple dictionary, to around 40 millisecs.


NB I have also built a Web-based standalone version of it using 10.0.0 (dp1), which can be 
found at


https://www.tweedly.org/BoggleSolver/BoggleSolver.html

Note - the "Load URL ..." portion does not yet work in the web version. Loading is fairly slow, 
but the run times re (IMHO) impressive - 80msecs against the 40msecs or so running in the IDE. 
I am very impressed by the performance of this early web implementation.


Having a 'solver' like this opens up possible new games such as:

1. given we have 25 grid positions, and 25 letters (omitting 'Q'), what arrangement of letters 
gives the most, or least, words.


2. given a random selection of letters, what arrangement gives most/least words.

3. (a 2-player game) given an arrangement of letters, change one letter and increase the number 
of words that can be formed; score the value of the increase (or decrease), playing 
alternately, until neither player can get a positive score change.


Alex.


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode



--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Sorting cards problem solved

2022-01-02 Thread J. Landman Gay via use-livecode
There seems to be some interest in the recipe content, or maybe the puzzle, given the number of 
downloads. At any rate, if you downloaded already, please replace the Sort button with the 
revised script:


on menupick pWhich
  put the last word of pWhich into tFld
  sort cards by the short id of this cd -- import order; keep first 13 cards at 
front
  mark cds where there is a fld "category" and fld "category" <> empty -- real 
recipes only
  sort marked cards by field tFld
  if the num of cd "index" <> 1 then
set the num of cd "index" to 1
set the num of cd "eggsaver" to 2
  end if
end menupick

Or if you want a fixed version, it's here for a week:


And...the client is pleased but noticed it all sorts very nicely except for the last card, 
which is in the correct category but out of alphabetical order. Anyone care to figure out why?


   - sort by title -- okay
   - sort by category -- Last card is wrong. Others are okay.

BTW, I tried Alex's suggestion of adding Title fields to the first two cards but LC hung until 
I hit Cmd-period. But Mark Wieder says it worked for him. I'm staring blankly.



On 1/2/22 2:46 PM, J. Landman Gay via use-livecode wrote:
Well, it was an interesting puzzle. The "mark" property has come up before but I didn't think 
it through enough. This seems to work:


   put the last word of pWhich into tFld -- popup menu with fld names
   sort cards by the short id of this cd -- import order; keep first 13 cards 
at front
   mark cds where there is a fld "category" and fld "category" <> empty -- tag 
real recipes only
   sort marked cards by field tFld -- "category" or "title"

Those who have never used The Ancient Xtalks may not know about the mark command. I used it all 
the time back in the dark ages but didn't think the solution would be so obvious. Mark Wieder 
jogged my memory.


So, duh. I hope I'm not kidding myself.

There's one day left before the link I posted expires. I've tagged 20 recipes I want to try. 
You might like to do that too. The client doesn't mind, he wants to share the stack with the 
world and is debating whether to fund a standalone so people won't have to install LC.





--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


ANN: BoggleSolver now on sample stacks

2022-01-02 Thread Alex Tweedly via use-livecode

I've put a little 'game' up on "sample stacks", and also on the web.

It "solves" Boggle style puzzles, i.e. you give it a 5x5 grid of 
letters, and it finds all words within it, following the prescribed 
rules - words are formed by moving to adjacent (including diagonal) grid 
positions, and you cannot re-use a grid position within a word. You can 
modify the input field, and click on "Solve it" to see the new results.


The list of words is that used by Jacqueline in her JQBoggle game.

The UI is very basic - but there is one clever (I think) thing within 
it. It uses a dictionary of words which is a hierarchical 
character-by-character array, so it represents not only "what is a word" 
but also "what can be the initial substring of a word", and therefore it 
can prune the search tree immediately. This takes the time to solve a 
puzzle down from approx 10 - 50 minutes using a simple dictionary, to 
around 40 millisecs.


NB I have also built a Web-based standalone version of it using 10.0.0 
(dp1), which can be found at


https://www.tweedly.org/BoggleSolver/BoggleSolver.html

Note - the "Load URL ..." portion does not yet work in the web version. 
Loading is fairly slow, but the run times re (IMHO) impressive - 80msecs 
against the 40msecs or so running in the IDE. I am very impressed by the 
performance of this early web implementation.


Having a 'solver' like this opens up possible new games such as:

1. given we have 25 grid positions, and 25 letters (omitting 'Q'), what 
arrangement of letters gives the most, or least, words.


2. given a random selection of letters, what arrangement gives 
most/least words.


3. (a 2-player game) given an arrangement of letters, change one letter 
and increase the number of words that can be formed; score the value of 
the increase (or decrease), playing alternately, until neither player 
can get a positive score change.


Alex.


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Sorting cards problem solved

2022-01-02 Thread J. Landman Gay via use-livecode
Well, it was an interesting puzzle. The "mark" property has come up before but I didn't think 
it through enough. This seems to work:


  put the last word of pWhich into tFld -- popup menu with fld names
  sort cards by the short id of this cd -- import order; keep first 13 cards at 
front
  mark cds where there is a fld "category" and fld "category" <> empty -- tag 
real recipes only
  sort marked cards by field tFld -- "category" or "title"

Those who have never used The Ancient Xtalks may not know about the mark command. I used it all 
the time back in the dark ages but didn't think the solution would be so obvious. Mark Wieder 
jogged my memory.


So, duh. I hope I'm not kidding myself.

There's one day left before the link I posted expires. I've tagged 20 recipes I want to try. 
You might like to do that too. The client doesn't mind, he wants to share the stack with the 
world and is debating whether to fund a standalone so people won't have to install LC.


--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Sorting cards problem, and a link

2022-01-02 Thread Rick Harrison via use-livecode
Ouch!  That’s why I always charge an hourly rate,
and never quote by the job.

Here’s hoping you solve your problem soon!

Rick

> On Jan 2, 2022, at 1:17 AM, J. Landman Gay via use-livecode 
>  wrote:
> 
> On 1/1/22 11:30 PM, Rick Harrison via use-livecode wrote:
>> I’ve been looking at the exchange of messages here which had made me
>> want to ask, why are you sorting cards at all?
>> Wouldn’t it be easier just to use array pointers or an index for the cards.
>> You can sort the pointers however you like and the cards never have to
>> move at all according to your sort.  You can do all of your sorting
>> experiments that way, and just go to the correct card that your
>> pointer index tells you to go to.  It might be quicker too.
> 
> In hindsight, you bet. This was one of those jobs I thought would take a day 
> or so, squeezed in over a weekend between my long-term project. A quick 
> export/import, minor visual adjustments, and done. The existing scripts were 
> minimal, mostly one-liners dating back to a novice using HC. In fact, the 
> only scripts I actually added were to convert some duplicate buttons to 
> popups and adjust for Cmd-F so it would work the way he was used to instead 
> of opening the LC Find dialog.
> 
> And mostly it did work, thanks to LC's compatibility. I hadn't planned on 
> doing anything major and bid as such. If I'd known ahead of time there was 
> going to be a problem I might have set up an alternate method to start with.
> 
> But then my curiosity took over, so I posted here and now it's a puzzle to be 
> solved. When that happens I find it hard to let go. If no here can figure it 
> out I'll probably fix it off the clock and write off the time.
> 
> -- 
> Jacqueline Landman Gay | jac...@hyperactivesw.com
> HyperActive Software   | http://www.hyperactivesw.com
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode