Discuss Scratch

AwesomePerson238243
Scratcher
100+ posts

"contains" block

contains
this block would scan a string or number for a given character, and report true if it finds that character. this is useful in many different ways.

also, please comment with any suggestions, problems, workarounds, or just offer your support.

Last edited by AwesomePerson238243 (May 6, 2017 09:04:22)

LegendaryTooth
Scratcher
85 posts

"contains" block

whenclickedsetcontains?tonotgfdjscratchjgkfcontainsscratchsetcontains?tono123456contains51

definestring1containsstring2setnto0repeatuntiln=lengthofstring1changenby1set# of string1tonset# of string2to0setstring2?toyesrepeatuntil#ofstring2=lengthofstring2change# of string2by1ifnotletter#ofstring1ofstring1=letter#ofstring2ofstring2thensetstring2?tonoelsechange# of string1by1ifstring2?=yesthensetntolengthofstring1ifstring2?=yesthensetcontains?toyes

Sorry, couldn't get them connected.
The first input should result in
contains?
being yes, whereas the second input should result in
contains?
being no.

Last edited by LegendaryTooth (May 6, 2017 11:03:05)

Powered by DjangoBB