I really think that scratch needs an () contains letter [] block
This would make it easier for keywords and filtering also good for making people answer a question and not have a certain character.
E.g
when gf clicked ask [What is your name?] and wait if (answer) contains letter [a]
Last edited by Tbtemplex97 (2013-01-04 17:34:20)
Offline
That, and a substring block: (letters (start) to (end) of [string])
Would make string manipulation a whole lot easier. c:
Offline
i would really like more string manipulation blocks built in. hopefully procedures can do the trick.
Offline
lalala3 wrote:
Even better, just
<[] contains []?>so we can use it for strings longer than a single character.
yeah
i wuz just gonna say that
Offline
Workaroundable
Repeat length of (string to be checked)
Change I by one
If item I = check
Set yes to one
Offline
It is workaroundable.
when gf clicked ask [What is your name?] and wait add (answer) to [List v] if <[list v] contains [thing]> say [That can't be right!]
Last edited by sonicfan12p (2013-01-18 12:34:26)
Offline
sonicfan12p wrote:
It is workaroundable.
when gf clicked ask [What is your name?] and wait add (answer) to [List v] if <[list v] contains [thing]> say [That can't be right!]
That's not what they want.
However, I've made many workarounds.
Offline
It can be made as a custom block, when 2.0 comes out
define: (string) contains (letter)? set [i v] to [1] repeat (length of (string)) if <(letter (i) of (string)) = (letter)> return true end change [i v] by [1] end return falseI think we won't be able to make reporter blocks (I hope it's not true D: ), though, so you'll have to work around that.
Last edited by technoguyx (2013-01-18 12:50:38)
Offline
firedrake969_test wrote:
sonicfan12p wrote:
It is workaroundable.
when gf clicked ask [What is your name?] and wait add (answer) to [List v] if <[list v] contains [thing]> say [That can't be right!]That's not what they want.
However, I've made many workarounds.
Then what do they want? It seems to do the exact same thing as they said.
Offline
Support. A "( ) contains ( )" block would be very useful!
Offline
sonicfan12p wrote:
firedrake969_test wrote:
sonicfan12p wrote:
It is workaroundable.
when gf clicked ask [What is your name?] and wait add (answer) to [List v] if <[list v] contains [thing]> say [That can't be right!]That's not what they want.
However, I've made many workarounds.Then what do they want? It seems to do the exact same thing as they said.
Not close. We want a method to check to see if a specified string contains another specified string (well, some people want it to be a single character, but I feel that's too limited).
Offline
technoguyx wrote:
It can be made as a custom block, when 2.0 comes out
define: (string) contains (letter)? set [i v] to [1] repeat (length of (string)) if <(letter (i) of (string)) = (letter)> return true end change [i v] by [1] end return falseI think we won't be able to make reporter blocks (I hope it's not true D: ), though, so you'll have to work around that.
It'd still be pretty useful to have as a standard block.
The bad thing is that you cannot have two of those running at the same time though.
Offline
ImagineIt wrote:
technoguyx wrote:
It can be made as a custom block, when 2.0 comes out
define: (string) contains (letter)? set [i v] to [1] repeat (length of (string)) if <(letter (i) of (string)) = (letter)> return true end change [i v] by [1] end return falseI think we won't be able to make reporter blocks (I hope it's not true D: ), though, so you'll have to work around that.
It'd still be pretty useful to have as a standard block.The bad thing is that you cannot have two of those running at the same time though.
What, 2.0 blocks can't have local variables? Ouch.
Last edited by lalala3 (2013-01-20 10:37:55)
Offline
lalala3 wrote:
ImagineIt wrote:
technoguyx wrote:
It can be made as a custom block, when 2.0 comes out
define: (string) contains (letter)? set [i v] to [1] repeat (length of (string)) if <(letter (i) of (string)) = (letter)> return true end change [i v] by [1] end return falseI think we won't be able to make reporter blocks (I hope it's not true D: ), though, so you'll have to work around that.
It'd still be pretty useful to have as a standard block.The bad thing is that you cannot have two of those running at the same time though.
What, 2.0 blocks can't have local variables? Ouch.
Nope. You could if you had a million different lists, but nobody wants to do that.
Offline
technoguyx wrote:
It can be made as a custom block, when 2.0 comes out
define: (string) contains (letter)? set [i v] to [1] repeat (length of (string)) if <(letter (i) of (string)) = (letter)> return true end change [i v] by [1] end return falseI think we won't be able to make reporter blocks (I hope it's not true D: ), though, so you'll have to work around that.
It'd still be pretty useful to have as a standard block.
You can do it with BYOB
Offline
bump - i hope this gets added to scratch
Offline
bubby3 wrote:
You can do it with BYOB
True.
It's a shame 2.0 blocks can't have local variables. D:
Offline
technoguyx wrote:
bubby3 wrote:
You can do it with BYOB
True.
It's a shame 2.0 blocks can't have local variables. D:
yeah ;o
Offline
so () contains [] is what is good?
Offline