So I'm trying to make a name gen (LIke the ultimate warriors name gen). I'm making two lists, one for each half of the name. Now I don't know how to get it to
a. get it to put the two together (randomly)
b. get the name it generates to show up
Can anyone help?
TIA,
Soka
Offline
Here:
The 'Name 1' list is the first part of the name, and the 'Name 2' list the second. The (item [any] of [list]) block picks a random item of the list. the (join [] []) block puts two strings together, and this one says (join [Name] (join [ ] [Name])), joining the first name, then space, then the last name. The say block says the value of the full name.
Last edited by The-Whiz (2010-06-19 19:55:22)
Offline
Well, I'd suggest making a list for the possible parts of the name, or two if you want the halves to consist of different possible parts. For instance, if you want them both to come from the same list of halves of names, make one list, otherwise, make two. Fill the list(s) up with your name halves.
Then use the "Pick random" block to decide which halves go, and the join block to make the finished product.
The below example assumes you're using one list, called "half." It uses two variables to store the halves, and another one to store the finished product:
When Green Flag clicked set [half1] to (item (pick random (1) to (length of [half])) of [half]) set [half2] to (item (pick random (1) to (length of [half])) of [half]) set [name] to (join (half1) (half2))
Or, graphically:
It should work fine. If you made 2 lists, just change the second block which picks random items to this; which essentially just changes the list:
set [half2] to (item (pick random (1) to (length of [halftwo])) of [halftwo])
Or,
Hope that helped!
EDIT - TheWhiz's way is better, much simpler.
Last edited by coolstuff (2010-06-19 19:57:10)
Offline
thanks guys!!!!! It's working!!!
Offline
Lol, without checking, I bet the Insult Generator is not off-topic Chrisb. I made a name generator that did redneck, rapper, and rpg names. What makes these generators on topic is that they do exactly what the op asked about.
ps. I never uploaded mine btw
Offline
Uchum27 wrote:
Does anyone know how to make a variable into a slideing variable/a variable with a slide to move and change the variable?
Right click on the variable and select "slider."
Offline
da123 wrote:
Uchum27 wrote:
Does anyone know how to make a variable into a slideing variable/a variable with a slide to move and change the variable?
Right click on the variable and select "slider."
Good answer! Also, to add onto what da123 said, you can right click on the variable display while it is a slider and select "set slider min and max" to fully adjust your slider settings.
In the future, it's probably a good idea to make your own topics about these kinds of inquiries rather than posting it on irrelevant threads. Thanks!
Offline
coolstuff wrote:
da123 wrote:
Uchum27 wrote:
Does anyone know how to make a variable into a slideing variable/a variable with a slide to move and change the variable?
Right click on the variable and select "slider."
Good answer! Also, to add onto what da123 said, you can right click on the variable display while it is a slider and select "set slider min and max" to fully adjust your slider settings.
In the future, it's probably a good idea to make your own topics about these kinds of inquiries rather than posting it on irrelevant threads. Thanks!
I didn't learn that until I had used Scratch for about 2.5 years.
Offline