This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2013-01-04 17:32:17

Tbtemplex97
Scratcher
Registered: 2011-11-12
Posts: 100+

If () Contains letter []

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)


Online Status: http://blocks.scratchr.org/API.php?action=onlineStatus&user=Tbtemplex97
Darkspace Coming Soon!, Try the Singleplayer Demo

Offline

 

#2 2013-01-04 17:50:22

technoguyx
Scratcher
Registered: 2008-10-18
Posts: 1000+

Re: If () Contains letter []

That, and a substring block: (letters (start) to (end) of [string])

Would make string manipulation a whole lot easier. c:


http://getgnulinux.org/links/en/linuxliberated_4_78x116.png

Offline

 

#3 2013-01-04 18:09:34

Wes64
Scratcher
Registered: 2011-08-19
Posts: 1000+

Re: If () Contains letter []

i would really like more string manipulation blocks built in. hopefully procedures can do the trick.


Experienced 2.0 Tester: Ask me questions!
Using Firefox 13.0, Flash plugin version 11.4.402.287, and Windows XP Professional.

Offline

 

#4 2013-01-04 18:16:54

lalala3
Scratcher
Registered: 2008-10-03
Posts: 100+

Re: If () Contains letter []

Even better, just

<[] contains []?>
so we can use it for strings longer than a single character.


http://img515.imageshack.us/img515/9374/signature2nt.png

Offline

 

#5 2013-01-04 18:34:08

mythbusteranimator
Scratcher
Registered: 2012-02-28
Posts: 1000+

Re: If () Contains letter []

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


http://www.foxtrot.com/comics/2012-04-01-fdb37077.gif
clicky

Offline

 

#6 2013-01-14 02:12:28

Programmer_112
Scratcher
Registered: 2012-02-17
Posts: 100+

Re: If () Contains letter []

Workaroundable

Repeat length of (string to be checked)
Change I by one
If item I = check
    Set yes to one


http://i49.tinypic.com/rk60py.png

Offline

 

#7 2013-01-18 07:22:56

30-1
Scratcher
Registered: 2012-08-08
Posts: 100+

Re: If () Contains letter []

support.


http://i.imgur.com/ocOya7x.gif
I. Text I Based I Games I

Offline

 

#8 2013-01-18 08:08:18

taddl
Scratcher
Registered: 2009-03-08
Posts: 100+

Re: If () Contains letter []

YES!
I support


http://blocks.scratchr.org/API.php?action=projects&amp;type=newest&amp;return=image&amp;user=taddl
http://blocks.scratchr.org/API.php?user=taddl&amp;action=projects&amp;type=newest&amp;return=text&amp;num=1

Offline

 

#9 2013-01-18 12:34:16

sonicfan12p
Scratcher
Registered: 2011-11-16
Posts: 1000+

Re: If () Contains letter []

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)


Why are the secret organizations getting all the attention?  mad

Offline

 

#10 2013-01-18 12:39:45

firedrake969_test
Scratcher
Registered: 2012-08-08
Posts: 500+

Re: If () Contains letter []

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.


Alt of Firedrake969.

Offline

 

#11 2013-01-18 12:49:15

jvvg
Scratcher
Registered: 2008-03-26
Posts: 1000+

Re: If () Contains letter []

This feature is available in a bunch of mods, but it is useful.
Support, but it should be contains any string at all, not just a letter.


http://tiny.cc/zwgbewhttp://tiny.cc/e1gbewhttp://tiny.cc/zygbewhttp://tiny.cc/izgbew
Goodbye, Scratch 1.4  sad                                                        Hello Scratch 2.0!  smile

Offline

 

#12 2013-01-18 12:50:15

technoguyx
Scratcher
Registered: 2008-10-18
Posts: 1000+

Re: If () Contains letter []

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 false
I 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.

Last edited by technoguyx (2013-01-18 12:50:38)


http://getgnulinux.org/links/en/linuxliberated_4_78x116.png

Offline

 

#13 2013-01-18 13:10:21

sonicfan12p
Scratcher
Registered: 2011-11-16
Posts: 1000+

Re: If () Contains letter []

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.


Why are the secret organizations getting all the attention?  mad

Offline

 

#14 2013-01-20 09:55:26

OverPowered
Scratcher
Registered: 2012-07-27
Posts: 100+

Re: If () Contains letter []

Support. A "( ) contains ( )" block would be very useful!


Newest project: Tunnel TEST ~http://blocks.scratchr.org/API.php?user=OverPowered&amp;action=onlineStatus~ On my mind: Unicameralism

Offline

 

#15 2013-01-20 10:19:09

lalala3
Scratcher
Registered: 2008-10-03
Posts: 100+

Re: If () Contains letter []

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).


http://img515.imageshack.us/img515/9374/signature2nt.png

Offline

 

#16 2013-01-20 10:33:38

ImagineIt
Scratcher
Registered: 2011-02-28
Posts: 1000+

Re: If () Contains letter []

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 false
I 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

 

#17 2013-01-20 10:37:38

lalala3
Scratcher
Registered: 2008-10-03
Posts: 100+

Re: If () Contains letter []

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 false
I 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)


http://img515.imageshack.us/img515/9374/signature2nt.png

Offline

 

#18 2013-01-20 11:01:12

ImagineIt
Scratcher
Registered: 2011-02-28
Posts: 1000+

Re: If () Contains letter []

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 false
I 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

 

#19 2013-01-20 11:49:10

bubby3
Scratcher
Registered: 2012-11-19
Posts: 44

Re: If () Contains letter []

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 false
I 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

 

#20 2013-01-24 07:40:59

Tbtemplex97
Scratcher
Registered: 2011-11-12
Posts: 100+

Re: If () Contains letter []

bump - i hope this gets added to scratch


Online Status: http://blocks.scratchr.org/API.php?action=onlineStatus&amp;user=Tbtemplex97
Darkspace Coming Soon!, Try the Singleplayer Demo

Offline

 

#21 2013-01-24 11:22:37

technoguyx
Scratcher
Registered: 2008-10-18
Posts: 1000+

Re: If () Contains letter []

bubby3 wrote:

You can do it with BYOB

True.

It's a shame 2.0 blocks can't have local variables. D:


http://getgnulinux.org/links/en/linuxliberated_4_78x116.png

Offline

 

#22 2013-01-24 11:25:15

mythbusteranimator
Scratcher
Registered: 2012-02-28
Posts: 1000+

Re: If () Contains letter []

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


http://www.foxtrot.com/comics/2012-04-01-fdb37077.gif
clicky

Offline

 

#23 2013-01-25 11:10:39

Tbtemplex97
Scratcher
Registered: 2011-11-12
Posts: 100+

Re: If () Contains letter []

so () contains [] is what is good?


Online Status: http://blocks.scratchr.org/API.php?action=onlineStatus&amp;user=Tbtemplex97
Darkspace Coming Soon!, Try the Singleplayer Demo

Offline

 

#24 2013-01-25 12:11:44

CN12
Scratcher
Registered: 2012-07-15
Posts: 1000+

Re: If () Contains letter []

I support


Click this on April 15th to see the new album from The 10th Dimension!
http://oi48.tinypic.com/23tqhyw.jpg

Offline

 

#25 2013-01-25 14:07:41

lalala3
Scratcher
Registered: 2008-10-03
Posts: 100+

Re: If () Contains letter []

mythbusteranimator wrote:

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

You can probably propose for it to be changed, so why don't you?


http://img515.imageshack.us/img515/9374/signature2nt.png

Offline

 

Board footer