I have a coding lab that wants me to edit the "For i" control block to count in different intervals. The "For i" block by default counts up by 1 if Start < End, but changing the "Set increment to" variable in the block editor to a different number and hitting apply does nothing. What am I missing?
You have to click on this switch so that it will run your function
Also for some reason, you have to click ok for your changes to be saved (apply doesn't work on primitives, which is a bug that probably should be fixed).
It's also nice to see that some snap courses are already teaching students about editing the primitives. I wasn't expecting that so soon.
This was driving me insane. The class is purely online with no lab discussions and the teacher's office hours are all during my other classes. The lab doesn't mention this anywhere. Thank you so much.
My guess is that the curriculum predates the 5.0 change of FOR from a library block to a primitive. That's certainly true of BJC!
Oh, well at least it still works with the ability to edit primitives.
Wow, for (i) = (1) to (10) {
}
was a library block?
yep
Yes, if you edit the primitive you'll see the original library code. I used it as an example of why you might want to ringify a block, namely the end test, and that's why I wrote it to allow for counting downward! A simplified version
is one of the displays in the header of the main web page.
We were (and are!) very proud that users can invent control structures such as FOR, something you can't do in those grownup languages because you can't make your own syntax. It was largely for the sake of FOR that we invented C-shaped input slots and upvars.
like the sliding images? I can't find any
Huh, you're right. It used to be there! Like this:
➞
➞
i found this image
on the homepage for Snap! 4 (via the wayback machine), but it was removed some time in 2016.
i'm gonna add that back as part of my extension, just waiting for @jadga to finish experimenting with the website first
Yeah, that's the one!
am I supposed to look at something?
sorry
Cheers,
jadga
we took out the for image when we included the tools library and the for-loop wasn't a custom block anymore. Now we could add it to the website again, since all blocks are custom blocks and pipe is a primitive too
It’s been a while since we’ve seen jadga — their last post was 10 months ago.
Wait, what? Aren't you the person I talked with about the main website a few weeks ago?
nah, that was probably Michael, he's changed a couple of things to make it more accessible.
And we're still testing everything, but I think so far it looks good
Oh, ok
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.