Discuss Scratch

bobbybee
Scratcher
1000+ posts

~tosh~ public beta

WooHooBoy wrote:

gtoal wrote:

Question: how do you enter comments in Tosh? I don't care if they're lost when saving to Scratch sb2 files, I just want to annotate a tosh file.

thanks

G
You can't right now, I recommend defining a “comment” block and use that.
Using ; as the name is handy for this.
gtoal
Scratcher
1000+ posts

~tosh~ public beta

I've no doubt someone has reported this already but tosh has major problems with custom blocks whose names contain the ‘%’ character. Unfortunately that includes quite a lot of my projects.

G

bobbybee
Scratcher
1000+ posts

~tosh~ public beta

gtoal wrote:

I've no doubt someone has reported this already but tosh has major problems with custom blocks whose names contain the ‘%’ character. Unfortunately that includes quite a lot of my projects.

G

Conversely for variables with the ‘?’ character,
gtoal
Scratcher
1000+ posts

~tosh~ public beta

The link to github is broken. I thought the web-based version was released there?

I'm going on vacation where I won't have any internet access, so I wanted to put the web-based version of tosh on my portable so I could code while at sea.

Fortunately there are very few files needed…

pi@frankenputervar/www/html/app $ ls -lR
.:
total 504
drwxr-xr-x 2 pi pi 4096 Jul 11 20:21 filesaver
-rw-r–r– 1 pi pi 4763 Apr 8 20:05 icons.svg
-rw-r–r– 1 pi pi 2241 Jul 11 20:37 index.html
-rw-r–r– 1 pi pi 19275 Apr 8 20:05 tosh-min.css
-rw-r–r– 1 pi pi 475760 Apr 8 20:05 tosh-min.js

./filesaver:
total 4
-rw-r–r– 1 pi pi 3257 Apr 8 20:05 FileSaver.min.js


very neat system to be implemented with only 5 files.
liam48D
Scratcher
1000+ posts

~tosh~ public beta

gtoal wrote:

The link to github is broken. I thought the web-based version was released there?

I'm going on vacation where I won't have any internet access, so I wanted to put the web-based version of tosh on my portable so I could code while at sea.

Fortunately there are very few files needed…

pi@frankenputervar/www/html/app $ ls -lR
.:
total 504
drwxr-xr-x 2 pi pi 4096 Jul 11 20:21 filesaver
-rw-r–r– 1 pi pi 4763 Apr 8 20:05 icons.svg
-rw-r–r– 1 pi pi 2241 Jul 11 20:37 index.html
-rw-r–r– 1 pi pi 19275 Apr 8 20:05 tosh-min.css
-rw-r–r– 1 pi pi 475760 Apr 8 20:05 tosh-min.js

./filesaver:
total 4
-rw-r–r– 1 pi pi 3257 Apr 8 20:05 FileSaver.min.js


very neat system to be implemented with only 5 files.
The source code is almost definitely not made with just one JavaScript file - it's probably just been packed into one file by some tool.

On the other hand, that does make it pretty portable.
gtoal
Scratcher
1000+ posts

~tosh~ public beta

I had a block called:

Assert: Len (CAR) == Len (CDR)

the ‘==’ disappeared in the tosh version.
blob8108
Scratcher
1000+ posts

~tosh~ public beta

gtoal wrote:

the ‘==’ disappeared in the tosh version.
There are pretty strict restrictions on symbols in variable/procedure names, in order to make tosh parseable while still allowing spaces in names. tosh deliberately strips out symbols it doesn't like when you import a project; that shouldn't affect how the project runs.
I've no doubt someone has reported this already but tosh has major problems with custom blocks whose names contain the ‘%’ character.
What names are you using containing ‘%’? I added a feature to alllow %-specs for inputs in order to try and support “hacked” blocks. This never added much benefit and I should probably remove it in the next release!

liam48D wrote:

The source code is almost definitely not made with just one JavaScript file - it's probably just been packed into one file by some tool
Correct – it's called Make!
gtoal
Scratcher
1000+ posts

~tosh~ public beta

blob8108 wrote:

gtoal wrote:

I've no doubt someone has reported this already but tosh has major problems with custom blocks whose names contain the ‘%’ character.
What names are you using containing ‘%’? I added a feature to alllow %-specs for inputs in order to try and support “hacked” blocks. This never added much benefit and I should probably remove it in the next release!

I have lots of procedures (custom blocks) that include % in the name. When that happens, tosh totally fails to convert those programs.

I've seen two behaviours. In one program I think I saw a \ inserted before the % and the program did run, in another program all the blocks with % in the names were red and the code wouldn't run.
blob8108
Scratcher
1000+ posts

~tosh~ public beta

bobbybee wrote:

Conversely for variables with the ‘?’ character,
Wait, what?
bobbybee
Scratcher
1000+ posts

~tosh~ public beta

blob8108 wrote:

bobbybee wrote:

Conversely for variables with the ‘?’ character,
Wait, what?
I save with a variable ending in ? (hello world?). When I reload the sb2, tosh changes it to hello world?1, or something like that. Not a big deal – the project still works – but it's somewhat annoying.
djsparta
Scratcher
100+ posts

~tosh~ public beta

Tosh tosh.
IcyCoder
Scratcher
1000+ posts

~tosh~ public beta

Is there an update log?
djsparta
Scratcher
100+ posts

~tosh~ public beta

How do I make a topic?
SimpleScratch
Scratcher
500+ posts

~tosh~ public beta

Hi
Just came to try Tosh again (Chrome browser Win10) but no turtle graphic is appearing on the stage

Should it be there or do I have to do an intial show?

liam48D
Scratcher
1000+ posts

~tosh~ public beta

SimpleScratch wrote:

Hi
Just came to try Tosh again (Chrome browser Win10) but no turtle graphic is appearing on the stage

Should it be there or do I have to do an intial show?

Same here. Looks like there's some issues going on.. a bunch of dependencies from gabelerner.github.com no longer appear to be hosted, and whenever I click on the compile/run button, there's an error in my console – “users must implement getResult()”, tosh-min.js.

EDIT: tosh.min.js -> tosh-min.js

Last edited by liam48D (Sept. 26, 2016 10:58:19)

blob8108
Scratcher
1000+ posts

~tosh~ public beta

Yeah, I thought canvg might be broken. It was already on my list of things to fix this week

Anyway, should be fixed now. Remember to flush your cache!
IcyCoder
Scratcher
1000+ posts

~tosh~ public beta

blob8108 wrote:

Yeah, I thought canvg might be broken. It was already on my list of things to fix this week

Anyway, should be fixed now. Remember to flush your cache!
YAY!!!
mobluse
Scratcher
100+ posts

~tosh~ public beta

I have a feature request: Create variables automatically. This would be good when you paste code from discussions on e.g. Facebook into Tosh. Variables are created automatically in Scratch 2 when you e.g. drag in blocks from the backpack. Here is an example where I had to create i5, i10 and iSum manually in order to run it:

when flag clicked
set i5 to 0
repeat 161
set i10 to 160 - i5
set iSum to 5 * i5 + 10 * i10
if iSum = 1085 then
say (join join (i5) “ femmor, ” join (i10) “ tior.”)
end
change i5 by 1
end

It would also be good if the code was auto-indented.
jokebookservice1
Scratcher
1000+ posts

~tosh~ public beta

With the above, perhaps at the bottom a little notice pops up saying “Create undeclared variables” and when you click it, it adds all of the variables, and the notice goes away. Perhaps it could slide as it comes up from the bottom? And I think it should only appear after you press a space after the variable name (in case you are in the process of typing the var name)

Last edited by jokebookservice1 (Nov. 16, 2016 18:34:40)

blob8108
Scratcher
1000+ posts

~tosh~ public beta

Although it would be nice to have, detecting undefined variables is difficult since variable names can contain spaces! However it might be sufficient to tokenise the lines and look for “set” followed by the word “to” – since I don't allow the word “to” inside variable names.

Detecting variable reporters is pretty much impossible, so that's never gonna happen.

Powered by DjangoBB