Code Errors regarding NYT Connections Recreation

Hi! I have been receiving some issues regarding expecting a native object to be passed and some issues about strings and buttons. I am attempting to recreate NYT Connections.

Thank you,
My code can be accessed here: Imgur: The magic of the Internet.

:question:

New York Times ?

yes, the new york times connections game, where there are 16 words and you have to organize them into 4 word groups!

Never heard of it.

Post a copy of the game rules?

Also,
(Canned Reply: ABG- Export & Upload .aia)
Export your .aia file and upload it here.

export_and_upload_aia

Is the answer built in, like


,

or is that just a starting position?

Connections.aia (8.0 KB)

I still don't have an answer on how to judge completion of the puzzle, so here is a sample code to allow reordering into 4 groups.

I used 4 ListViews, initially all words in the first ListView.
Selecting a ListView Element moves it to the next ListView, with wraps.

I sort the Element lists after each move, to allow easy comparison list to list with the answer (wherever that is.)

sample run

word_groups.aia (3.4 KB)

It was quicker to write my own, than to dive into your blocks.

image

If this is a group, what is the rationale?

The other three groups look like they might have rationales. (transitive verbs, directions, newspaper sections, ?)

You might consider adding the rationales to the word sets, for a better game play experience.

Or is this app just a workbench for doing the puzzle of the day, without any data entry facilities?


Connections1.aia (8.2 KB)

I had to revamp your Table Arrangement (shudder) into nested Horizontal and Vertical Arrangements to allow the app to run visibly on different screen shapes.

The error in the Submit button Click event is because you failed to distinguish between the Button Components and their Text values when you set up your global lists.
(You also need a SelectedButtonComponents list.)

Use the Companion and the Do It facility to help you debug.

P.S. Consider writing a value procedure (function) that would accept a word and return the Button component that contains that word. The use the advanced list blocks to generate a list of Buttons from your list of words, and traverse that list.


Connections.aia (9.0 KB)

I was able to get your code working (I guess) by adding two functions

  • a word to button converter, and
  • a button to word converter.

That way, I was able to build on your global selectedWordsList variable, without having to add an extra global list of selected buttons.

Then I scanned everywhere you were using that words list to feed a Button component, and convert accordingly.

You also needed to clear that selectedWordsList after all your Submit button work, otherwise it would not accept clicks past the 4th click of the first group.

sample run
From my play testing, it needs a bit more working syncing buttons to word lists when dealing with partially correct answers.

I leave that to you.