How to make a closure in Snap!?

how can I evaluate variable "x" so that I can make a new function(closure)?
it doesn't work this way:

Hi! Welcome to the forum.

That should work; what happens when you try it?

Actually you can do it more simply, though:
untitled script pic (1)

it still doesn't work: it does not evaluate

Could you show precisely what you did and what result you got?

the image is here:

Like this:

now i can make my own random number algorithm without a global variable!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.