Discuss Scratch
- Discussion Forums
- » Advanced Topics
- » Snap! user discussion
- bharvey
- Scratcher
1000+ posts
Snap! user discussion
In the Tools library are blocks CATCH and THROW.[break out v] of loop::control cap
[continue with next iteration v] of loop::control cap
You can make custom looping blocks that include the two CATCHes, and define custom BREAK and CONTINUE blocks with the two THROWs. Nested loops should work properly too, although if you use the same catchtags then of course you can't break out of multiple levels at once.
Last edited by bharvey (Feb. 16, 2017 04:14:37)
- MichaelOlifant
- Scratcher
35 posts
Snap! user discussion
Where's the generator project?
The CAPITALBOYS will protect me from kumquats.
- MichaelOlifant
- Scratcher
35 posts
Snap! user discussion
I have an implementation of this here.It would definitely simplify our lives if every block reported a value, as in Lisp. And, even though you were able to solve your problem by just calling an expression, sometimes you do need to call a multi-step script that ends with a report block. To do so, drag a command-shaped ring from the top of the Operators palette into the existing ring slot in CALL, and it'll replace the reporter-shaped one. However, the report block is a stack block, and the call block's ring can only accept reporter statements. Aside from making a named custom reporter, how can I use the report block?
Note: Snap! uses applicative order evaluation, and so technically you can't use the Y combinator itself; you have to use the more complicated applicative-order variant. But for most purposes you can just use
http://imageshack.com/a/img924/5965/T0nFcW.png
which, technically, isn't a combinator at all, but gets the job done.The company, which invests in startups, was founded by Paul Graham, who made his fortune by getting software projects running a lot faster than his competitors, because he wrote it in Lisp. See I thought Y combinator was a company that (donated to? somethinged? invested in? uhh) startups.http://www.paulgraham.com/avg.html for example. Anyway, he named the company after the lambda calculus recursion operator.
The CAPITALBOYS will protect me from kumquats.
- bharvey
- Scratcher
1000+ posts
Snap! user discussion
What generator project? Where's the generator project?
I have an implementation of this here.Indeed. Every time I try to reproduce that without looking it up I get a headache. I see why you have to use λf . f several times, but I can't get them properly nested.
- MichaelOlifant
- Scratcher
35 posts
Snap! user discussion
The one with the yield block.What generator project? Where's the generator project?I have an implementation of this here.Indeed. Every time I try to reproduce that without looking it up I get a headache. I see why you have to use λf . f several times, but I can't get them properly nested.
The CAPITALBOYS will protect me from kumquats.
- bharvey
- Scratcher
1000+ posts
Snap! user discussion
I'm sorry, I guess I'm slow tonight, but I still have no idea what you're talking about. Some thread I've already forgotten? The one with the yield block.
- MichaelOlifant
- Scratcher
35 posts
Snap! user discussion
What? You posted it yesterday 14:04:14. 2 P.M. isn't nighttime.I'm sorry, I guess I'm slow tonight, but I still have no idea what you're talking about. Some thread I've already forgotten? The one with the yield block.
The CAPITALBOYS will protect me from kumquats.
- MichaelOlifant
- Scratcher
35 posts
Snap! user discussion
I have a block for JSON objects:
The CAPITALBOYS will protect me from kumquats.
- MichaelOlifant
- Scratcher
35 posts
Snap! user discussion
Of course, my version isWhat generator project? Where's the generator project?I have an implementation of this here.Indeed. Every time I try to reproduce that without looking it up I get a headache. I see why you have to use λf . f several times, but I can't get them properly nested.
where is the Y combinator-ed variant and the ring is curried.
Equation:
Y = λ f.(λ x.f (x x)) (λ x.f (x x))
The CAPITALBOYS will protect me from kumquats.
- jokebookservice1
- Scratcher
1000+ posts
Snap! user discussion
Timezones…What? You posted it yesterday 14:04:14. 2 P.M. isn't nighttime.I'm sorry, I guess I'm slow tonight, but I still have no idea what you're talking about. Some thread I've already forgotten? The one with the yield block.
- bharvey
- Scratcher
1000+ posts
Snap! user discussion
I checked through all of yesterday and didn't find a relevant post from myself. I'm so confused. What? You posted it yesterday 14:04:14.
Are you talking about the thread system in the reference manual?
- MichaelOlifant
- Scratcher
35 posts
Snap! user discussion
I don't see it in YouTube…It'll use Forge for Minecraft 1.11. I haven't had much time to work on it unfortunately. Will we use minecraft forge? or is it compatible for 1.11?
The CAPITALBOYS will protect me from kumquats.
- Scratch_Mapping
- Scratcher
100+ posts
Snap! user discussion
How to make this in Snap? Is there a block that does this or do i need to make one?
for ((i)::control) in list [] {
}::control
:: obsolete
:: #FFFFFF
:: pen
- gdpr533f604550b2f20900645890
- Scratcher
1000+ posts
Snap! user discussion
If you select File, then Import tools, you will find a list block called How to make this in Snap? Is there a block that does this or do i need to make one?for ((i)::control) in list [] {
}::control
for each ((item)::list) of [list input] {.
}::list
- MichaelOlifant
- Scratcher
35 posts
Snap! user discussion
Hello,
Here is a summary of a project.
http://nathalierun.net/depotLibre/milieuDyn0.html
I don't understand why I am obliged to put a bloc “Forevor” on sprites A and B to make my project turn correctly.
The time reactivity is very slow…
Thank's for some help.
The project is here
http://nathalierun.net/depotLibre/Milieu.xml
I have a workaround Woh ! Thank you…here.
What I'm trying to do is some dynamical geometric project.
Sprite A is a point. Sprite B another point.
Sprite named M is the midpoint of (A,B).
If you move A or B, M must follow.
Like here :
https://scratch.mit.edu/projects/96670059/
The CAPITALBOYS will protect me from kumquats.
- xly
- Scratcher
100+ posts
Snap! user discussion
nathalierun wrote:
Woh ! Thank you…
What I'm trying to do is some dynamical geometric project.
Sprite A is a point. Sprite B another point.
Sprite named M is the midpoint of (A,B).
If you move A or B, M must follow.
Like here :
https://scratch.mit.edu/projects/96670059/
Look at this : http://snap.berkeley.edu/snapsource/snap.html#present:Username=xleroy&ProjectName=middle
Woh ! Thank you…
What I'm trying to do is some dynamical geometric project.
Sprite A is a point. Sprite B another point.
Sprite named M is the midpoint of (A,B).
If you move A or B, M must follow.
Like here :
https://scratch.mit.edu/projects/96670059/
Look at this : http://snap.berkeley.edu/snapsource/snap.html#present:Username=xleroy&ProjectName=middle
- MichaelOlifant
- Scratcher
35 posts
Snap! user discussion
I have a project that uses the Pythagorean theorem here.
The CAPITALBOYS will protect me from kumquats.
- MichaelOlifant
- Scratcher
35 posts
Snap! user discussion
The length of the list isn't divisible by 3. So storing the ring in a variable won't work, but using it explicitly works. Of course what Jens should have done in his EVERY example is this:
http://snap.berkeley.edu/keepevery.png
PS Actually I'm not sure why this works, given that the length of the list isn't divisible by 3. Jens?
PPS I mean, why does it work the second time you click it?
The CAPITALBOYS will protect me from kumquats.
- Gabriel2900
- Scratcher
100+ posts
Snap! user discussion
The reporter below doesn't report “atchscray”
(join (cascade until (<(list [a] [e] [i] [o] [u] @delInput @addInput:: list) contains (letter (1) of [])> @addInput:: ring grey) ((join (all but first letter of []::operators) (letter (1) of []) @delInput @addInput::operators) @addInput::ring grey) [scratch] ((#)::control)::control) [ay] @delInput @addInput::operators)
- 21399annie
- Scratcher
2 posts
Snap! user discussion
Hi,
Great program! Currently using Snap for my AP Computer Science Principles exam. One question though, would it be possible to allow us to use text when creating a sprite? It'd make everything much easier since we don't have to write it ourselves / use the say function.
Thank you!
Great program! Currently using Snap for my AP Computer Science Principles exam. One question though, would it be possible to allow us to use text when creating a sprite? It'd make everything much easier since we don't have to write it ourselves / use the say function.
Thank you!