Discuss Scratch

Sigton
Scratcher
1000+ posts

How do I make a random word generator?

Recently I've been building a hangman game but I would quite like the words to be picked at random, put I have no idea how to do this. Any help?

Sigton
drmcw
Scratcher
1000+ posts

How do I make a random word generator?

Put all the words in a list and use
(i
itemrandomofyour word list
Sigton
Scratcher
1000+ posts

How do I make a random word generator?

drmcw wrote:

Put all the words in a list and use
(i
itemrandomofyour word list

That was what I was originally going to do, but instead of having a dictionary full of words, I wanted it to make up words, like a word generator rather than a word picker, to stop it from lagging as much and being much more time efficient.

Sigton
drmcw
Scratcher
1000+ posts

How do I make a random word generator?

A word generator would be much slower than picking a word from a list and would be difficult to create real words unless you're happy with random letters?
Sigton
Scratcher
1000+ posts

How do I make a random word generator?

drmcw wrote:

A word generator would be much slower than picking a word from a list and would be difficult to create real words unless you're happy with random letters?

That's the problem, I was wondering how to stop ending up with a bunch of gibberish.

Sigton
drmcw
Scratcher
1000+ posts

How do I make a random word generator?

There are no rules for making words, which is why it would be difficult. There are some rules you could use but there are also many exceptions in English that would make it so difficult.

Use a list of words there's a hangman game on Scratch where the computer guesses your word. It has a list of over 80000 words I think, so is not slow!
drmcw
Scratcher
1000+ posts

How do I make a random word generator?

gtoal
Scratcher
1000+ posts

How do I make a random word generator?

Sigton wrote:

drmcw wrote:

A word generator would be much slower than picking a word from a list and would be difficult to create real words unless you're happy with random letters?

That's the problem, I was wondering how to stop ending up with a bunch of gibberish.

Sigton

You won't. The only way to avoid that would be to look up the generated ‘word’ in a dictionary and that will be even slower than picking a random word from a word list. Just do it, it's not that expensive. The overhead comes when you first start the program and it downloads the dictionary as part of the data initialization.
kookookkookoo
Scratcher
1 post

How do I make a random word generator?

i have tried what DRMCW, i wasn't shore how, but it worked! (i don't know how to post the code blocks) i will continue this but i can't know, please tell me how.
deck26
Scratcher
1000+ posts

How do I make a random word generator?

kookookkookoo wrote:

i have tried what DRMCW, i wasn't shore how, but it worked! (i don't know how to post the code blocks) i will continue this but i can't know, please tell me how.
Please don't necropost - create a new topic if you need help and refer to this one if necessary.
UltimateDestruction
Scratcher
1 post

How do I make a random word generator?

drmcw wrote:

Put all the words in a list and use
(i
itemrandomofyour word list
Thanks!
deck26
Scratcher
1000+ posts

How do I make a random word generator?

UltimateDestruction wrote:

drmcw wrote:

Put all the words in a list and use
(i
itemrandomofyour word list
Thanks!
No need to necropost to thank anyone - all it does is bring an old topic to the top of the forum.
rsneha
New Scratcher
7 posts

How do I make a random word generator?

Try this site : https://grammarchecker.net/random-word-generator/

Last edited by rsneha (June 12, 2019 06:46:38)

Warrior-kat
New Scratcher
2 posts

How do I make a random word generator?

I want to be able to have a list of words which I can then have my project choose one word at random from the list. I am super bad at coding and it would be great if someone could tell me what blocks to use.
mlcreater
Scratcher
1000+ posts

How do I make a random word generator?

Warrior-kat wrote:

I want to be able to have a list of words which I can then have my project choose one word at random from the list. I am super bad at coding and it would be great if someone could tell me what blocks to use.
In Scratch 3.0 (the current version), you could use:
itempickrandom1tolengthoflist of wordsoflist of words
The darker blocks appear in the Variables section after at least one list is created.
The lighter block is in the Operators section.
Warrior-kat
New Scratcher
2 posts

How do I make a random word generator?

mlcreater wrote:

Warrior-kat wrote:

I want to be able to have a list of words which I can then have my project choose one word at random from the list. I am super bad at coding and it would be great if someone could tell me what blocks to use.
In Scratch 3.0 (the current version), you could use:
itempickrandom1tolengthoflist of wordsoflist of words
The darker blocks appear in the Variables section after at least one list is created.
The lighter block is in the Operators section.

Thank you so much! I'll try that.

Powered by DjangoBB