GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Anyway to sort a table mid game? Change column order

fmakawafmakawa Posts: 559Member

Hi Folks,
So I'm working on a word puzzler and I've hit a snag. One of my tiles can only be made to fit several letters. So I made it identify which of those letters are in particular words and choose one of them. Now, I have several other tiles and they take up the rest of the letters in the word. I'm using tables to prevent the repletion of letters in the tiles. So example, my word is 'SOLIDIFY' and the 'specified' tile uses the letter 'F' and the remain letters should be then distributed to 'regular' tiles. My problem lies in how they identify the regular tiles. How do I move the 7th column or whichever column has my 'specified' tile to the beginning so that the remain tiles can just pick from the next columns. The selection of the 'specified' tile is random since I want unique puzzles rather than set one. Perhaps I'm looking it all wrong? Perhaps I use duplication of tables and delete columns as selections are made? Any ideas?

Comments

  • ArmellineArmelline Posts: 4,780Member, PRO

    Don't sort the table. Sounds like you'd be best with a "current level" table, which you fill with the letters of the current word. Pick a random letter in the word, put it in column or row 1. Then put the rest (in order, or in a random order) into the remaining rows/columns.

    That's probably going to be the easiest solution.

  • fmakawafmakawa Posts: 559Member

    **** but how do I do that. Making a current level table is fine. Choosing the specific letter is fine but ensuring the remaining letters are placed and there is no duplication is where im struggling with.

  • fmakawafmakawa Posts: 559Member

    bump

  • ArmellineArmelline Posts: 4,780Member, PRO

    A very very rough example of the kind of things you'll need to do. Please note this is very very rough, though, and would need some fine-tuning to ensure it always ran properly. Should give you a decent idea of how to approach this problem, though.

  • fmakawafmakawa Posts: 559Member

    thanks. It doesn't make the remaining letters random though. which simplifies the whole thing. having chosen the first letter, which is the important one, the rest randomise so that you cant just guess which word they came from.

  • ArmellineArmelline Posts: 4,780Member, PRO

    @fmakawa said:
    thanks. It doesn't make the remaining letters random though. which simplifies the whole thing. having chosen the first letter, which is the important one, the rest randomise so that you cant just guess which word they came from.

    It's very easy to randomise the remaining letters. In fact, it's slightly easier, as we can just pick a random letter every time. I totally misread your first post, this version is much closer to what you wanted.

  • fmakawafmakawa Posts: 559Member

    Thanks!! perfect!

Sign In or Register to comment.