Modified contain custom block

This block will report true if any element anywhere in the list contains the search item

containsAnywhere

Notes:

  • This is different to the behaviour of the standard Snap! contains predicate which only works on simple 1-dimensional lists
  • I'm not entirely happy with the block labelling so would welcome alternative suggestions for it :slight_smile:

_ deep contains _

Sounded good so tried to change my labels but it kept on adding (2) to it but I couldn't find another block with same name

After searching through the project xml, I found a deep contains grey reporter inside of the APL library where block (as I'd been playing with that to see if it was useful for me)

How come this reporter doesn't show up in the palette?
[edit] Had a search thru the manual for hidden and found the section on hiding blocks in projects


which led me to finding it in the Hide Blocks menu option

image

I knew a facility had been added to hide blocks a project but hadn't realised/forgotten this could be used in block libraries

Can us muggles do this is as well? Can we hide some of our custom helper blocks in our own saved libraries?

Also, as a UI comment, I think I would have an Unhide option visible on the main menu when some blocks are hidden

image
Having to select Hide and then scroll thru all the blocks to untick something is quite counter-intuitive

Of course, if it was designed that way so that students have to go to great lengths to find the hidden blocks - then it's been well done :slight_smile:

Oh, yeah, absolutely!

Oh, don't get me started. Teachers love this feature -- they think it's the best thing about Snap!. We were very insistent that there had to be a way for students to escape, but you're right, I think it could be a bit more discoverable. Pre-8.0 there was an "unhide all" option in the context menu of the palette background. Now that option is called "hide blocks." It should really be something like "set hidden blocks" to indicate that it lets you both hide and unhide, or maybe "show blocks" and reverse the meaning of the checkboxes in that dialog. (Which may happen for a different reason: Teachers complain that when they load an old project with hidden blocks into a newer Snap! that has new primitives, those new blocks appear in the palette.)

:slight_smile: Just tried it and it worked nicely

I'll post a little tutorial for others