Search the Community
Showing results for tags 'promt'.
-
Hey, so I have another question about how to write a function. What I have is a prompt, that asks, what does "..." mean? What I want is a function that randomly chooses a word from a dictionary to enter in the quotation marks. Here is my dictionary: var translation = {};// Spanish dictionarytranslation.spanish = {};translation.spanish["gato"] = "cat";translation.spanish["perro"] = "dog";translation.spanish["hola"] = "hello";// English dictionarytranslation.english = {};translation.english["cat"] = "gato";translation.english["dog"] = "perro";translation.english["hello"] = "hola"; There are two buttons. When I press the spanish button I want a spanish word to go in the quotes, and I would respond with the word translated in english. When I press the english button I want an english word to go in the quotes, and I would respond with the word translated in spanish. I would use this to review spanish vocab. How would I make a function that randomly chooses a word to go in the quotes. I know I would have to use math.random, but otherewise I do not know how to set it up. Please provide suggestions and ideas, thanks!