Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » How do you make a name generator?
- spycat-123
-
Scratcher
34 posts
How do you make a name generator?
How do you code a name generator in Scratch? The whole
add [] to [list v]thing is confusing me when generating names. Thanks!
- mstone326
-
Scratcher
1000+ posts
How do you make a name generator?
What do you mean by name generator? Can you expand on what you are trying to do or share your project to see what you have so far.
- ThanksAnts_Thants
-
Scratcher
63 posts
How do you make a name generator?
add [Name] to [list v]Type a name into there, click it once and it will be added to the list then delete the name and write another, repeat until you have as many names on the list as you want.
Then you can use.
(item (Random v) of [list v] :: list)In something like a
say []Somewhere which will pick one of the names at random and say it.
Last edited by ThanksAnts_Thants (Feb. 12, 2017 02:45:33)
- asivi
-
Scratcher
1000+ posts
How do you make a name generator?
Hi, it could take a while for you… by reading http://www.gutenberg.org/ebooks/24374 you will get some ideas about construct personal names in English.
- duckboycool
-
Scratcher
1000+ posts
How do you make a name generator?
Hi, it could take a while for you… by reading http://www.gutenberg.org/ebooks/24374 you will get some ideas about construct personal names in English.I think that they mean by giving a random name when something happens, if so, ThanksAnts_Thants method would work although I wouldn't recommend this
say []block for it.
- asivi
-
Scratcher
1000+ posts
How do you make a name generator?
It could be.Hi, it could take a while for you… by reading http://www.gutenberg.org/ebooks/24374 you will get some ideas about construct personal names in English.I think that they mean by giving a random name when something happens, if so, ThanksAnts_Thants method would work although I wouldn't recommend thissay []block for it.
@spycat-123 I've found https://scratch.mit.edu/discuss/topic/233605/ it is pretty helpful for your purpose.
- monkeybike123
-
Scratcher
100+ posts
How do you make a name generator?
when green flag clicked
forever
repeat until <(length) = [???]>
change [length v] by (1)
add (letter (pick random (1) to (26)) of [abcdefghijklmnopqrstuvwxyz]) to [list v]
end
set [name v] to (list :: list)
delete (All v) of [list v]
set [length v] to ((1) - (10))
end
this should a sequence of random letters, in no particular order
- duckboycool
-
Scratcher
1000+ posts
How do you make a name generator?
This wouldn't make names.(Usually anyway) And I'm not sure if that's what they mean. Although it is hard to understand in general. Could you (the OP) please clarify what you want.when green flag clicked
forever
repeat until <(length) = [???]>
change [length v] by (1)
add (letter (pick random (1) to (26)) of [abcdefghijklmnopqrstuvwxyz]) to [list v]
end
set [name v] to (list :: list)
delete (All v) of [list v]
set [length v] to ((1) - (10))
end
this should a sequence of random letters, in no particular order
- monkeybike123
-
Scratcher
100+ posts
How do you make a name generator?
This wouldn't make names.(Usually anyway) And I'm not sure if that's what they mean. Although it is hard to understand in general. Could you (the OP) please clarify what you want.when green flag clicked
forever
repeat until <(length) = [???]>
change [length v] by (1)
add (letter (pick random (1) to (26)) of [abcdefghijklmnopqrstuvwxyz]) to [list v]
end
set [name v] to (list :: list)
delete (All v) of [list v]
set [length v] to ((1) - (10))
end
this should a sequence of random letters, in no particular order
it set the variable word to some random letters, the only way to get names would be to manually add them to a list
- duckboycool
-
Scratcher
1000+ posts
How do you make a name generator?
I know what it's doing. I was saying that it wouldn't create names. Anyway, I'd like to focus on this part of my post.
Although it is hard to understand in general. Could you (the OP) please clarify what you want.
- monkeybike123
-
Scratcher
100+ posts
How do you make a name generator?
I know what it's doing. I was saying that it wouldn't create names. Anyway, I'd like to focus on this part of my post.Although it is hard to understand in general. Could you (the OP) please clarify what you want.
what did you mean by that? please could you explain!
- duckboycool
-
Scratcher
1000+ posts
How do you make a name generator?
I mean that your method wouldn't actually create names, and would instead spout out random letter to a variable. I was saying that the OP (orignal post) was unclear on their meaning, and should explain in more depth what they meant. Now lets move on from this please.
- spycat-123
-
Scratcher
34 posts
How do you make a name generator?
So I was thinking of making something like a Warrior name generator…..(has two parts- prefix and suffix) but I dunno how…
- ThanksAnts_Thants
-
Scratcher
63 posts
How do you make a name generator?
Could have two lists, one with prefix names and the other with suffix.
Then use
Will probably need to add a space between them though.
(Easiest way is manually hitting space before entering the suffix names imo)
Then use
(join (item (Random v) of [prefix v] :: list) (item (Random v) of [suffix v] :: list)
Will probably need to add a space between them though.
(Easiest way is manually hitting space before entering the suffix names imo)
Last edited by ThanksAnts_Thants (Feb. 12, 2017 20:38:09)
- duckboycool
-
Scratcher
1000+ posts
How do you make a name generator?
For the space you could do;
Quote it to see what it is fully.
(join (join (item (pick random (1) to (length of [Prefix v] :: list)) of [Prefix v] :: list) [ ]) (item (pick random (1) to (length of [Suffix v] :: list)) of [Suffix v] :: list))
Quote it to see what it is fully.
Last edited by duckboycool (Feb. 12, 2017 20:35:06)
- asivi
-
Scratcher
1000+ posts
How do you make a name generator?
Hi, i was a bit bored, so i've spemt some time making a Random Cat Names thing for you. Ihope it helps.
- spycat-123
-
Scratcher
34 posts
How do you make a name generator?
Hi, i was a bit bored, so i've spemt some time making a Random Cat Names thing for you. Ihope it helps.Thanks!!!!!
- gtoal
-
Scratcher
1000+ posts
How do you make a name generator?
Is this what you're looking for? https://scratch.mit.edu/projects/90739052/
- leopard999999999
-
Scratcher
1 post
How do you make a name generator?
I need to generate a random warrior name and I don't know what to do. Warrior names need variety
- asivi
-
Scratcher
1000+ posts
How do you make a name generator?
I need to generate a random warrior name and I don't know what to do. Warrior names need variety
Just do use one of the solutions in responses above.
Reporting to be closed.
- Discussion Forums
- » Help with Scripts
-
» How do you make a name generator?