Discuss Scratch

EYzhou
Scratcher
16 posts

How do you make spirites talk pig latin????

I cant make my spirite talk pig latin! Plz help!
deck26
Scratcher
1000+ posts

How do you make spirites talk pig latin????

I think you need to give more info if you want help. Do you mean talking with sound or using ‘say’ for example. I suggest with a few examples of what you want it to say.
CoolGuyBug
Scratcher
100+ posts

How do you make spirites talk pig latin????

Try this:
sayigpay atinlayfor2secs

OR, if you want to make a translator thing, you can do something like this:
askSay a word and we'll translate it to Pig Latin!andwaitiflengthofanswer<10thensetfirst lettertoletter1ofanswersetpig latintojoinletter2ofanswerjoinletter3ofanswerjoinletter4ofanswerjoinletter5ofanswerjoinletter6ofanswer...andsoonsetpig latintojoinpiglatinjoinfirstletteraysaypiglatinelsesaySorry, that has too many letters!

Last edited by CoolGuyBug (May 14, 2016 02:03:19)

VicTwenty
Scratcher
83 posts

How do you make spirites talk pig latin????

That's simpler than I thought it would be CoolGuyBug!
Just_Ciaran
Scratcher
100+ posts

How do you make spirites talk pig latin????

VicTwenty wrote:

That's simpler than I thought it would be CoolGuyBug!
I know you're just trying to help (or possibly just trying to get scratcher status), but don't just make posts unless you have something to say that will help another person. The main problem is it bumps up topics that have already been resolved and in turn means that other topics don't get answered.

Last edited by Just_Ciaran (May 14, 2016 03:36:28)

EYzhou
Scratcher
16 posts

How do you make spirites talk pig latin????

deck26 wrote:

I think you need to give more info if you want help. Do you mean talking with sound or using ‘say’ for example. I suggest with a few examples of what you want it to say.
whenclicked
Cyoce
Scratcher
500+ posts

How do you make spirites talk pig latin????

First post in quite some time.

Try this. It'll work for any length string; this means they can't give you a word that's too long!

Alternatively, you can just copy what I have here. Ask if you have questions!
whenthisspriteclickedaskEnter a word pleaseandwaitsetinputtoanswersetpig latinto this will be your pig latinsetcounterto1 this is the current letter for the looprepeatuntilcounter=lengthofinputchangecounterby1 go to the next lettersetpig latintojoinpiglatinlettercounterofinput//addthatlettertoyourpiglatin repeat until we have the last lettersetpig latintojoinpiglatinjoinletter1ofinputay add the first letter and "ay" to the endsaypiglatin

Basically, this sets up a variable pig latin. It will add each letter but the first to pig latin, then add the first letter and “ay” to the end. How it loops through the input text is checking if the current letter is equal to empty; if you ask for a letter that is too big (for example, asking for letter 6 of “hello”, it will give you back an empty piece of text). We have this stored in the variable EMPTY for convenience.

Last edited by Cyoce (May 15, 2016 21:37:05)

deck26
Scratcher
1000+ posts

How do you make spirites talk pig latin????

Cyoce wrote:

First post in quite some time.

Try this. It'll work for any length string; this means they can't give you a word that's too long!

Alternatively, you can just copy what I have here. Ask if you have questions!
whenthisspriteclickedsetEMPTYto contain empty stringaskEnter a word pleaseandwaitsetinputtoanswersetpig latintoEMPTY this will be your pig latinsetcounterto1 this is the current letter for the looprepeatuntillettercounterofinput=EMPTYchangecounterby1 go to the next lettersetpig layintojoinpiglatinlettercounterofinput//addthatlettertoyourpiglatin repeat until we have the last lettersetpig latintojoinpiglatinjoinletter1ofinputay add the first letter and "ay" to the endsaypiglatin

Basically, this sets up a variable pig latin. It will add each letter but the first to pig latin, then add the first letter and “ay” to the end. How it loops through the input text is checking if the current letter is equal to empty; if you ask for a letter that is too big (for example, asking for letter 6 of “hello”, it will give you back an empty piece of text). We have this stored in the variable EMPTY for convenience.
I should probably have googled ‘pig latin’ before my earlier response!

@Cyoce's solution is fine but just use
repeatlengthofinput-1
If you're using input consisting of more than one word you'll need to look for separator characters - eg space, comma or whatever.
Cyoce
Scratcher
500+ posts

How do you make spirites talk pig latin????

deck26, you're right, I forgot about the length of () block for strings. Added to my answer.

Powered by DjangoBB