Anyway to sort a table mid game? Change column order

fmakawafmakawa Member Posts: 565

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 Member, PRO Posts: 5,364

    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 Member Posts: 565

    **** 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 Member Posts: 565

    bump

  • ArmellineArmelline Member, PRO Posts: 5,364

    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 Member Posts: 565

    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 Member, PRO Posts: 5,364

    @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 Member Posts: 565

    Thanks!! perfect!

Sign In or Register to comment.