I don't really like to write code for people, I rather people try it out for themselves and learn, especially new users...but there are so many examples doing things one way, I thought I would try another way and use more advanced techniques. I know you are new, and this is a little over your head, but if you can grasp this, then you are on your way.
You didn't exactly choose the easiest app to start with - lol.
This was done quickly. It as raw, and needs some TLC etc etc etc. It is an example, done quickly - okay - lol
This to steer you in a direction - to get you to focus your learning on certain things. Check the manual and tutorials to find out more about what I tried to do, what I used.
It works, it just isn't completed in any way or form... Its just to nudge you in the right direction.
Okay... I...
Created 2 functions, save and retrieve.
Functions pass on params and return values
I and you will use tokenat( it is the easier, but regex is also an option) I counted the spaces (" ") to determine number of words, I created a temp array to store 3 random numbers based on number words. So you don't randomly select same word, of course if player1 has written a word 2 or more times, player2 might get it twice or more.
I used tokenat to find the 3 random words using the temp random numbers.
Anyways, all the time I have.
You can find tutorials on all that I have used, obviously in separate tutorials, I just combined them.