Lowercase & Uppercase Chars

There's a much easier (and faster) way to do this...
[scratchblocks](map(<is[lowercase v]?::operators>@addInput::grey ring)over(split[Hello, world!]by(letter v)::operators)::list)[/scratchblocks]

Accidently pressed Ctrl + Enter. I just deleted it.

Just to inform people I created it.

Yeah, I know about that feature. But I don't like using pictures.

It only supports Latin Alphabet.

(Warning: More than you probably wanted to know about this, coming up.)

Actually, anything you create, in any medium, is automatically copyright. Those copyright notices used to be required, but now they're just a convenient way to let people track down who owns a copyright.

If you want to let anyone do anything with your work, you can explicitly disclaim copyright with a notice along the lines of "I, joecooldoo, the author of this work, hereby disclaim copyright in it, placing it in the public domain."

You can have more or less restrictive licenses on things you write. Many works under copyright have very restrictive licenses, so you have to pay money just to see the work, and even then you aren't allowed to make a copy of it. (Hence the name "copyright.")

People who want to let people use their stuff often use a Creative Commons license, especially if the stuff isn't a computer program, for which other more specific licenses are more commonly used. There are several CC licenses; I think there are five possible Boolean conditions, but not all 25 combinations are possible.

The thing about Snap! is that it doesn't make sense to publish a project on our web site unless you want people to use it. If you don't publish it, of course you can keep it to yourself. The only thing that's non-obvious about publishing on the Snap! site is that, because we believe in remixing, we require the use of the CC-BY-NC-SA (or, if you prefer, CC-BY-SA) license.

I wonder if this requirement is not only for publishing on the main Snap! community site, but also for posting here on the forums? I guess, it is.

It's not really comparable because you don't remix forum comments! But you can quote them, so I guess that's kinda related.

But they can see your username in the forum post and the project...

Ok, is this a better way to do that?

[scratchblocks]
(call ((map (<is [] (type) ? :: operators>@addInput :: ring grey) over (split (text) by ( v) :: operators) :: list) input names: ((text) :: grey) ((type) :: grey)­@delInput@addInput :: ring grey) with inputs: [Hello, World!] [lowercase]­@delInput@addInput :: control)
[/scratchblocks]

Not better, per se, just different. I'd like to think the user would know which inputs to change already.

The first input is the text, for example: "Hello, World!".
The second one is the type (none, lowercase or uppercase).

I vote for "better." Using higher order functions makes code so much more readable! But you're focusing on a different question, which is how to parameterize a script. And the best answer to that is to make it a procedure (a custom block (yes, I know you know that, but other people may read this)) with inputs, rather than build the example into the script, whether via CALL or some other way.

I know...

What does "parameterize" mean?

By the way, I want to know if there could be some optimizations for my custom blocks.

"Turn constant examples into vary-able (that's what 'variable' means!) inputs." It's like turning 3×4² into 3×a².

Looking further at the code, I couldn't find any optimization issues that I would know how to fix, but I like how you directly use booleans in math functions (as in untitled script pic). I didn't think anyone else did that.

All I really did was replace the FOR loop with a MAP block...

Just to make this smaller:

[scratchblocks]
(if <(type) = [uppercase]> then <not <(unicode of (letter (i) of (_text)) :: operators) < (j)>> else <(unicode of (letter (i) of (_text)) :: operators) < (j)> :: control)
[/scratchblocks]

&^%^(*((!!!!!

Explicit loops are MUCH more readable to us muggles :slight_smile:

Yeah, adult muggles who've been taught in bad languages. If we get first crack at a kid, HOFs are natural.

But honestly, if you find a loop readable, it's because you've learned the arcane skill of taking in the entire loop at a glance, the way a chess master can take in a chess position, and mentally transforming it into the equivalent of a HOF: "Oh, yeah, this loop transforms each word to its first letter" or whatever. If you were a beginner and actually had to walk through the loop, simulating a computer in your head, you wouldn't find loops so readable.

And unless you're a programming grand master, taking in the loop at a glance doesn't protect you against off-by-one errors and the like, which can't happen with HOFs.

And I say you have to be a grand-grand master to take a complicated HOF in at a glance :slight_smile: