The snippet of code I provided was a simplified example of drawing a grid (with your code) and I added the k which counts from 0 to 8.
You can access a 9 element array with this. This is what I did with an array which could also be shuffled.
I am not working on fixing your code and only offering insights that may lead to a solution for you.
Observations:
You did not use fill() before circle.
Random is in the draw() cycle and will change every cycle; consider putting it in setup() for now for testing and run your code for new random values each time.
I used shuffle() and it worked. It seems you are trying to write a custom shuffle() routine which is achievable with some effort.
Slow things down to see what is happening with a frameRate(1)
Hello @glv Thank you. yes its not very random, it is wither horizontal or vertical as suggested by @Hyperion65. I am trying to figure it out to make it a bit more random, but then making it even more random is going to lose its legibility. Its that bit that I am struggling with. However I do want to try to get a even more random version of it, just to compare both the designs. working on it now.
Yes, Thanks for your input. It helped me a lot in understanding the nuts and bolts of it. I have expanded it to a bigger grid and exploring how it can be pushed further!!
I do get this overlap sometimes, which I am trying to fix.
Thank you. I did try that, the complete randomness just makes it harder to distinguish the word. Much prefer it when it reads horizontally or vertically!!
yes, in that case the random number should be depending on the previous random value.
so the first time it is random(number of cells)
if it is at 7 (e.g.) then the next random should be 7± random(2) or another small value
then you will get something like 7,5,6,9,8,5,…
and not 7,0,8,2,3,9,1,5