Hardmath123 wrote:
So to get this straight, lists that in Scratch are dumped on teh stage to maek global should now be in the <variables> part of the <project> element in Snap! rather than that of the <stage>?
That's right.
Thanks!
Offline
Wow, those typos are embarrassing—I typed that in a rush.
Now to figure out how to fix that… my code is very functional and recursive, so it's almost hard to reference outer levels from the inside. bharvey would be proud—I think my code could be copied almost line-for-line into Scheme.
Offline
Hardmath123 wrote:
my code is very functional and recursive, so it's almost hard to reference outer levels from the inside
Hehe, "In theory, there is no difference between theory and practice. In practice, there is."
Offline
That's borderline incomprehensible…
I figured it out now (ugly hack, but I don't have a choice). Now I'm, testing every block to see if it works. It fails for sprite inputs.
Offline
error handling (and some other things) has been fixed. Please flush your caches and let me know, if those "crashes" still happen. Instead of showing a red outline and a bubble with an error message recent versions of Snap just went into an infinite loop. Now everything should be nice and stable again.
Offline
Just getting up to speed with BYOB, so I can teach the building of blocks to my GR 11 class. How does one "save" or export blocks such as the FOR loop created in the BYOB tutorial so that you can use them in other projects without having to re-create them? thanks
Offline
I assume you're using BYOB 3.1. Save the project with the block. When you want to use the block in another project, click File>Import… and select the project with the block.
In Snap! (the online version), simply click File>Export blocks…
Offline
OldCodger wrote:
http://www.hakank.org/minizinc/handshaking.mzn
Ah, interesting! I didn't know the problem came from Halmos; I read it in a puzzle column in some random magazine (long ago).
I think the "symmetry breaking" part of the program is sort of cheating, because you really have to know the solution already to know how far to require increasing values in the array. Really in a constraint language I'd like a way to say "only show isomorphically distinct solutions."
Now I'll have to see if I can translate that into my Logo logic puzzle program... probably not...
Offline
Hardmath123 wrote:
my code is very functional and recursive, so it's almost hard to reference outer levels from the inside. bharvey would be proud—I think my code could be copied almost line-for-line into Scheme.
I'm totally proud of you, for all sorts of reasons!
I don't understand the part about levels, though. Oh, you mean you want to use a variable from an outer scope that's shadowed by the same name in an inner scope?
Offline
Hardmath123 wrote:
Save the project with the block. When you want to use the block in another project, click File>Import… and select the project with the block.
Wait, you can import a project into another project?
I think a cleaner way to do this is export a sprite from the original project, which will carry with it all the custom blocks accessible to that sprite. Then import the sprite into your new project with the middle of the three "new sprite" buttons.
Offline
You can't import one project into another. But you absolutely can import a sprite or a blocks module into another project.
@Brian: I've got all of those stop variations from Scratch ready, just not yet in the palette. But I love the red stop sign
Last edited by Jens (2013-02-15 14:09:16)
Offline
@Jens & bharvey
For 2 days I have had SAVE problems.
This is probably (certainly ?) due to my using of *.svg Costumes "stolen" from Scratch 2.0 examples.
Your application can use them , but it can't be saved !!
Everything seems OK now !
Offline
Jens wrote:
nXIII wrote:
Why not <translate> or <message>?
Yeah, or why not <l> or <t>?
I don't understand—the <l> element already has a distinct meaning. <t> would be fine, but I don't think this use is frequent enough to merit a one-letter name.
Hardmath123 wrote:
Since when are you a mod? Is it just for testing 2.0, or for good?
For good
Last edited by nXIII (2013-02-15 19:40:02)
Offline
bharvey wrote:
OldCodger wrote:
http://www.hakank.org/minizinc/handshaking.mzn
Ah, interesting! I didn't know the problem came from Halmos; I read it in a puzzle column in some random magazine (long ago).
I think the "symmetry breaking" part of the program is sort of cheating, because you really have to know the solution already to know how far to require increasing values in the array. Really in a constraint language I'd like a way to say "only show isomorphically distinct solutions."
Now I'll have to see if I can translate that into my Logo logic puzzle program... probably not...
Hakank has a lot of good stuff. The symmetry breaking trick is widely used in solving pattern type problems in logic programming anyway. I think it requires a particular way of thinking to see where symmetry breaking can reduce the search or simplify the problem.
Constraint programming still seems to be out on a limb in the programming world though I find analysing problems in terms of their constraints is a useful approach to finding a functional solution. Plus I like solving these kind of puzzles.
Offline
OldCodger wrote:
bharvey wrote:
OldCodger wrote:
http://www.hakank.org/minizinc/handshaking.mzn
Ah, interesting! I didn't know the problem came from Halmos; I read it in a puzzle column in some random magazine (long ago).
I think the "symmetry breaking" part of the program is sort of cheating, because you really have to know the solution already to know how far to require increasing values in the array. Really in a constraint language I'd like a way to say "only show isomorphically distinct solutions."
Now I'll have to see if I can translate that into my Logo logic puzzle program... probably not...Hakank has a lot of good stuff. The symmetry breaking trick is widely used in solving pattern type problems in logic programming anyway. I think it requires a particular way of thinking to see where symmetry breaking can reduce the search or simplify the problem.
Constraint programming still seems to be out on a limb in the programming world though I find analysing problems in terms of their constraints is a useful approach to finding a functional solution. Plus I like solving these kind of puzzles.
Here is a link to a paper on symmetry in constraint programming
http://www.confounded.org/~ipg/papers/GentPetriePugetFinalDraft.pdf
Offline
bharvey wrote:
Hardmath123 wrote:
Save the project with the block. When you want to use the block in another project, click File>Import… and select the project with the block.
Wait, you can import a project into another project?
More like "onto": it dumps all the sprites (and thus blocks) onto your current project. That feature was used back when 08jackt made his SynOS in Scratch which could have imported apps created by third-party Scratchers (cool, eh?).
@nXIII: Congratulations!
Last edited by Hardmath123 (2013-02-15 21:07:42)
Offline
I'm going to maintain a to-do list on this thread now:
To-Do List for Snapin8r
(No specific order. Red means urgent. Tilde means I'm currently working on that feature and asterisk means I'm done.)
* Fix sprite inputs
• Ignore default value in custom blocks
• Truly global blocks/lists/variables
• Color inputs are iffy—using native hex support in Python
~ Comments!
• Support raster images
• Better help text/easier usage?
* Warp atomic blocks
• Variable watchers are iffy
• Empty boolean slots cause errors
Testing
• blob8108's Nodes puzzle
- Issue with SVG collision-checking
• blob8108's project with every single block (thanks, BTW, it's really helpful)
- Keeps failing due to bad block specs… my fault
• Jens' clone explosion project
- No idea why it fails
• nXIII's 3D world
- Issue with color conversion
Last edited by Hardmath123 (2013-02-18 08:29:35)
Offline
Hardmath123 wrote:
@nXIII: Congratulations!
Thanks!
If you have any more issues with the converter, I'm in the process of fixing some bugs in my own, so I might be able to help.
PS: You have two "done" indicators in your TODO list (gray and asterisk). Was that intentional?
Last edited by nXIII (2013-02-15 21:34:11)
Offline
You own? You mean BYOB3.1 to Snap, right?
And yeah, I should probably stick with asterisk.
Offline
Fixed the sprite input issue.
Offline