I'm trying to use Javascript to parse text that has been entered in a text box - which would combine a variety of user-generated variables to create random activities. This might make more sense looking at the example. Some example input might be:
Activity @Home @Out @Home Read @book for @time Clean up @room for @time @Out Eat at at @restaurant @book Enders Game Lord of the Rings @room bedroom garage basement @restaurant Red Robin McDonalds Starbucks @time 15 minutes 30 minutes 45 minutes 60 minutes
Pound/and signs would be used to separate different categories.
The output would then be determined randomly from the given input, for example:
"Eat at Starbucks." or "Read Lord of the Rings for 60 minutes." or "Clean garage for 30 minutes."
Is this doable? It seems like it should be fairly straightforward, but I do not know where to start. Any suggestions?
Thanks,
Albert