I added
ImageFrame new form: msg
to that place, and it crashed squeak. I got rid of the msg part in front, but it still caused an error.
Offline
I finally got it!
showValue | t1 t2 t3 t4 t5 | (#(#doReport #doMakeNewList #doCallWithArgs #doPauseThreadReporter ) includes: selector) ifTrue: [^ self showLambdaValue]. t1 _ false. [t2 _ self evaluate] ifError: [t1 _ true. t2 _ 'Error!']. (t2 isKindOf: Morph) ifTrue: [t2 _ t2 imageForm] ifFalse: [t2 isForm ifTrue: [t2 _ t2 form] ifFalse: [t2 _ t2 asString]]. (self isBooleanReporter or: [t2 = 'Error!']) ifTrue: [t2 _ t2 localized]. t3 _ (ScratchReporterToolTipMorph string: t2 for: self) left: self right; bottom: self top. ScratchTranslator isRTL ifTrue: [t3 right: self left]. t1 ifTrue: [t3 messageColor: Color red darker]. t4 _ self world. t4 addMorphFront: t3. ((t5 _ t4 bounds) containsRect: t3 bounds) ifFalse: [t3 bounds: (t3 bounds translatedToBeWithin: t5)]. self setProperty: #toolTip toValue: t3. t3 initialCursorPoint: Sensor cursorPoint. t3 startStepping
I was looking at the wrong part!
Offline
Wondering what it would take to create a block that:
* Would be connected to a very simple backend web service
* Web service would grab project Scratch/Squeak variable values and return a simple XML file (via the web)
Use cases would be:
* Web embeded Scratch projects would allow kids/developers to store (for example) game high scores to anyone wanting to post their score (online or perhaps Facebook)
If creating a block to post variable-values to a web service seems staight forward to anyone I would certainly be happy to create the web service script & host it - I would create something in PHP that would look for all "Post" variable-values and return them in a simple XML format.
Offline
bharvey wrote:
Billybob-Mario wrote:
More help is needed. Because BYOB uses every uppercase and lowercase letter, how can I use custom dropdown menus? Numbers and symbols don't work.
This has been sitting here unanswered for a long time so here's an answer:
It's not a law of nature that numbers and symbols don't work; some piece of code somewhere is making that true. Find it, and find out why. My guess is that there are two arrays of length 26 in the code.
When you find them, there are several things you can do, depending on how many new items you want to add. If just one or two, you could make them arrays of length 27, including @ (the character before A) and ` (the character before a).
Alternatively, you could pick one letter (X for eXtended is traditional) to mean that the byte after the X should be used to index a third table of 26 (using XX to mean whatever X used to mean), giving you 25 more entries.
Most radical of all, replace the entire mechanism with one that reads a string instead of a single byte, and then you can have as many entries as you want!
But the most important point here is that you have to actually learn to read the code yourself!
I didn't see this. I ended up making new classes for blocks that I added new args to.
Offline
Figured out how to run on linux!
Save as an .sh file:
#!/bin/sh
# Squeakvm wrapper to load BYOB image.
#------------------------------------------------------------
/usr/bin/scratch_squeak_vm \
-plugins /usr/lib/scratch/Plugins \
-vm-sound-pulse \
/path/to/BYOB.image "${@}"
edited Scratch.sh
Offline
Billybob-Mario wrote:
bharvey wrote:
Billybob-Mario wrote:
More help is needed. Because BYOB uses every uppercase and lowercase letter, how can I use custom dropdown menus? Numbers and symbols don't work.
This has been sitting here unanswered for a long time so here's an answer:
It's not a law of nature that numbers and symbols don't work; some piece of code somewhere is making that true. Find it, and find out why. My guess is that there are two arrays of length 26 in the code.
When you find them, there are several things you can do, depending on how many new items you want to add. If just one or two, you could make them arrays of length 27, including @ (the character before A) and ` (the character before a).
Alternatively, you could pick one letter (X for eXtended is traditional) to mean that the byte after the X should be used to index a third table of 26 (using XX to mean whatever X used to mean), giving you 25 more entries.
Most radical of all, replace the entire mechanism with one that reads a string instead of a single byte, and then you can have as many entries as you want!
But the most important point here is that you have to actually learn to read the code yourself!I didn't see this. I ended up making new classes for blocks that I added new args to.
Well, the particular piece of code that does this is CommandBlockMorph's #parseCommandSpec:. It uses the #isLetter method or something like that. Just remove that from the #ifTrue:ifFalse: and you can use whatever symbols you want. Alternatively, modify the entire method to use a "%IdentifierHere%" argument type.
Offline
I completed my VisualSortLibrary project. Available at http://www.sitibs.com/branches/moodle/mod/forum/discuss.php?d=1605 (just login as a guest by clicking on "login come ospite").
Enjoy
Last edited by s_federici (2010-10-18 11:25:34)
Offline
bbbeb wrote:
Amazing.
That is amazing.
If you mean my project, thanks a lot I would love to have suggestions from BYOBers (but also from Scratchers, as I'm developping an -unfortunately not so well designed- version for Scratch 1.4) about interesting features to add to the VisualSortLibrary project (http://www.sitibs.com/branches/moodle/mod/forum/discuss.php?d=1605).
What I'm thinking about is:
- showing different algorithms at the same time (on the same data)
- allowing the user to define its own ball sizes
- implementing more algorithms (but maybe on this other BYOBers can contribute!)
- deriving, in a non-mathematical way, the complexity of the algorithm (from the number of comparisons and swaps needed, hopefully from several consecutive runs)
- finding a way of allowing the user to run the algorithm at different levels of granularity, for example going straight to the swap, without having to look for all the comparisons (but I guess this is something that would impact on the design of BYOB; any idea Jens/Brian? I got this idea from the wonderful AIA tool for Algorithm Animation, by Linda Stern, http://ww2.cs.mu.oz.au/aia/)
Last edited by s_federici (2010-10-19 04:26:02)
Offline
s_federici wrote:
I would love to have suggestions from BYOBers (but also from Scratchers, as I'm developping an -unfortunately not so well designed- version for Scratch 1.4) about interesting features to add to the VisualSortLibrary project (http://www.sitibs.com/branches/moodle/mod/forum/discuss.php?d=1605).
Scratch version is now available at http://scratch.mit.edu/projects/s_federici/1364343.
Offline
I have a great suggestion for new features in BYOB. Since BYOB variables and parameters can be pretty much anything, why not let them be sprites as well? It probably would be complicated. All the sprite blocks need to have an added parameter for the sprite. Then sprites could be cloned and created. There could be blocks like "add script [ ] to sprite [ ]". this might not at all be possible but I think you should consider it.
Offline
developdood wrote:
Since BYOB variables and parameters can be pretty much anything, why not let them be sprites as well?
Oh, yes, first class sprites is very high on our list, certainly the first "big" change we'll make (as opposed to tiny improvements that can be done overnight). Thanks.
Offline
nice in working on windows 1 version 4 in byob its alot handier than scratch when it comes to compiling though it does malfunction as soon as v4 is done im putting it on website for downloading
Offline
Hi nueclearreaction,
thanks for checking out BYOB, I'm glad you like it! Could you please describe a little more in detail what it is that malfunctions for you? then I'd like to get a shot at fixing it.
Offline
Jens wrote:
Hi nueclearreaction,
thanks for checking out BYOB, I'm glad you like it! Could you please describe a little more in detail what it is that malfunctions for you? then I'd like to get a shot at fixing it.
I doesnt do anything until the block is done!
Offline
Jens wrote:
So, you want to define your own procedures and functions in Scratch? )?
You might as well try this new experimental prototype I have been developing over the last weeks. You can download and read through an
This prototype lets you build your own custom blocks in Scratch using the standard Scratch blocks, as well as other blocks you defined elsewhere. You can create your own command blocks (procedures) and reporter blocks (functions), both regular ("round") and boolean ("diamond"). You can specify for each block to be atomic (run at the speed of a single block) or interleafed. Your custom blocks are defined for each sprite and can be shared among projects together with the sprite they were created for. Oh, and you can even use a block within itself (recursion).
This prototype is very, very, experimental, so be prepared to encounter lots of bugs. I'd be very interested in feedback about your experiences and insights.
Enjoy!
-Jens
what about windows 7!!!!!!!!!
Offline
gog1 wrote:
Jens wrote:
So, you want to define your own procedures and functions in Scratch? )?
You might as well try this new experimental prototype I have been developing over the last weeks. You can download and read through an
This prototype lets you build your own custom blocks in Scratch using the standard Scratch blocks, as well as other blocks you defined elsewhere. You can create your own command blocks (procedures) and reporter blocks (functions), both regular ("round") and boolean ("diamond"). You can specify for each block to be atomic (run at the speed of a single block) or interleafed. Your custom blocks are defined for each sprite and can be shared among projects together with the sprite they were created for. Oh, and you can even use a block within itself (recursion).
This prototype is very, very, experimental, so be prepared to encounter lots of bugs. I'd be very interested in feedback about your experiences and insights.
Enjoy!
-Jenswhat about windows 7!!!!!!!!!
Please don't quote the first post in the thread, It ends up getting really off-topic. Did you notice that we're on the 35th page right now?
Offline
kinker wrote:
It doesnt do anything until the block is done!
If you want to see results onscreen while your program is running, make sure that you don't have the "Atomic" box checked in the Block Editor. Does that solve the problem?
Offline
The result of my last effort: miniC++ 2.0 (developed for BYOB). Have a look at http://scratch.mit.edu/projects/s_federici/1463982.
Last edited by s_federici (2010-12-07 16:23:06)
Offline
How do you upload BYOB projects in 3.0.8?
Offline