Discuss Scratch
- Discussion Forums
- » Suggestions
- » Show True Code
- Budderjohn
-
Scratcher
1 post
Show True Code
Make it where you can have the choice of seeing the actual code for games instead of the code blocks.
- iamunknown2
-
Scratcher
1000+ posts
Show True Code
What do you mean? The Scratchblocks ARE the actual code.
- Rumanti
-
Scratcher
1000+ posts
Show True Code
I think he meant like the one at Code.org, where you can see “your code as JavaScript”.
First, as per iamunknown2, the blocks ARE the ACTUAL code. So you don't need extra fancy features to do that.
Second, if what you asks is the JS code or similar- it's not effective. The “JavaScript code” displayed at, fore example, Code.org, is actually better phrased as algorithm or instructions. Just check out the code- turnLeft(); is NOT a pre-built function. So what does this mean? This means that you have to define and code yourself,from zero, what the turnLeft() function actually does. So.. Sorry, but I don't support. Keep thinking ideas, though, your next idea might be awesome! ;D
First, as per iamunknown2, the blocks ARE the ACTUAL code. So you don't need extra fancy features to do that.
Second, if what you asks is the JS code or similar- it's not effective. The “JavaScript code” displayed at, fore example, Code.org, is actually better phrased as algorithm or instructions. Just check out the code- turnLeft(); is NOT a pre-built function. So what does this mean? This means that you have to define and code yourself,from zero, what the turnLeft() function actually does. So.. Sorry, but I don't support. Keep thinking ideas, though, your next idea might be awesome! ;D
- iamunknown2
-
Scratcher
1000+ posts
Show True Code
Second, if what you asks is the JS code or similar- it's not effective. The “JavaScript code” displayed at, fore example, Code.org, is actually better phrased as algorithm or instructions. Just check out the code- turnLeft(); is NOT a pre-built function. So what does this mean? This means that you have to define and code yourself,from zero, what the turnLeft() function actually does. So.. Sorry, but I don't support. Keep thinking ideas, though, your next idea might be awesome! ;DFor easy reading…
To convert Scratch blocks to JavaScript wouldn't work very well.
On a related note, you could always make your own library (think JQuery).
- CatsUnited
-
Scratcher
1000+ posts
Show True Code
To convert Scratch blocks to JavaScript wouldn't work very well.Scratch scripts use JSON though.
- iamunknown2
-
Scratcher
1000+ posts
Show True Code
JSON != JSTo convert Scratch blocks to JavaScript wouldn't work very well.Scratch scripts use JSON though.
The JSON code is still in Scratch blocks format, and not in JS format.
- CatsUnited
-
Scratcher
1000+ posts
Show True Code
JSON != JS
The JSON code is still in Scratch blocks format, and not in JS format.
JSON.parse();
- MushroomMan99
-
Scratcher
100+ posts
Show True Code
I think he meant like the one at Code.org, where you can see “your code as JavaScript”.Scratch's drag and drop menu makes it easier than other programming languages.
First, as per iamunknown2, the blocks ARE the ACTUAL code. So you don't need extra fancy features to do that.
Second, if what you asks is the JS code or similar- it's not effective. The “JavaScript code” displayed at, fore example, Code.org, is actually better phrased as algorithm or instructions. Just check out the code- turnLeft(); is NOT a pre-built function. So what does this mean? This means that you have to define and code yourself,from zero, what the turnLeft() function actually does. So.. Sorry, but I don't support. Keep thinking ideas, though, your next idea might be awesome! ;D
- Zekrom01
-
Scratcher
1000+ posts
Show True Code
So you can see the actual JSON code for a project?
Semi-support, there isn't much need for it.
Semi-support, there isn't much need for it.
- Letsgopitt
-
Scratcher
500+ posts
Show True Code
I thought Scratch used Actionscript. Are they the same thing?To convert Scratch blocks to JavaScript wouldn't work very well.Scratch scripts use JSON though.
- stickfire-test
-
Scratcher
100+ posts
Show True Code
JSON is the format it uses to store the blocks used in a project (and other stuff, like variables and sprite information). Actionscript is the language Scratch is actually written in (I think) and what it interprets the blocks to.I thought Scratch used Actionscript. Are they the same thing?To convert Scratch blocks to JavaScript wouldn't work very well.Scratch scripts use JSON though.
- gdpr533f604550b2f20900645890
-
Scratcher
1000+ posts
Show True Code
I think he meant like the one at Code.org, where you can see “your code as JavaScript”.Easier to understand explanation: What Rumanti means is that the JS commands don't actually exist; they are made up and must be defined by a programmer.
First, as per iamunknown2, the blocks ARE the ACTUAL code. So you don't need extra fancy features to do that.
Second, if what you asks is the JS code or similar- it's not effective. The “JavaScript code” displayed at, fore example, Code.org, is actually better phrased as algorithm or instructions. Just check out the code- turnLeft(); is NOT a pre-built function. So what does this mean? This means that you have to define and code yourself,from zero, what the turnLeft() function actually does. So.. Sorry, but I don't support. Keep thinking ideas, though, your next idea might be awesome! ;D
- Zro716
-
Scratcher
1000+ posts
Show True Code
Well this topic kinda exploded into assumptions.
First, the Scratchblocks you see are the actual code, HOWEVER, behind the scenes, they are stored as a JSON file which is read by the Scratch interpreter, which runs in ActionScript. You can view the source code on github here, and the HTML5/JavaScript version being worked on here. So it really depends on what you mean by the “true code” - the blocks, the project.json file, or the interpreter that runs them.
As for your suggestion, albeit brief, I in fact support it. But the “code” I want shown is the JSON object, since that is probably the closest you'll get to Scratchblocks in a textual/code-like format despite it not actually being real code; if editable, it will allow us advanced users to modify/hack a project faster than downloading, extracting, editing, replacing, and uploading.
First, the Scratchblocks you see are the actual code, HOWEVER, behind the scenes, they are stored as a JSON file which is read by the Scratch interpreter, which runs in ActionScript. You can view the source code on github here, and the HTML5/JavaScript version being worked on here. So it really depends on what you mean by the “true code” - the blocks, the project.json file, or the interpreter that runs them.
As for your suggestion, albeit brief, I in fact support it. But the “code” I want shown is the JSON object, since that is probably the closest you'll get to Scratchblocks in a textual/code-like format despite it not actually being real code; if editable, it will allow us advanced users to modify/hack a project faster than downloading, extracting, editing, replacing, and uploading.
Last edited by Zro716 (Aug. 12, 2015 20:48:31)
- curtliom
-
Scratcher
21 posts
Show True Code
I agree with @Budderjohn. I've been wanting a scratch blocks to language code for a while now.


- Puppers
-
Scratcher
23 posts
Show True Code
Make it where you can have the choice of seeing the actual code for games instead of the code blocks.Go to the project editor (Look inside)
Hold shift and click “File” at the top right above the project name
Click “Save Project Summary”
Go to the .txt file for the project (it's wherever you saved it)
Open it
It will show variables, costumes, sound and then scripts.
- elemnts2002
-
Scratcher
1 post
Show True Code
Make it where you can have the choice of seeing the actual code for games instead of the code blocks.Go to the project editor (Look inside)
Hold shift and click “File” at the top right above the project name
Click “Save Project Summary”
Go to the .txt file for the project (it's wherever you saved it)
Open it
It will show variables, costumes, sound and then scripts.
thank you
- Blaze349
-
Scratcher
1000+ posts
Show True Code
Well this topic kinda exploded into assumptions.Apparently, ToU doesn't allowed hacked projects
First, the Scratchblocks you see are the actual code, HOWEVER, behind the scenes, they are stored as a JSON file which is read by the Scratch interpreter, which runs in ActionScript. You can view the source code on github here, and the HTML5/JavaScript version being worked on here. So it really depends on what you mean by the “true code” - the blocks, the project.json file, or the interpreter that runs them.
As for your suggestion, albeit brief, I in fact support it. But the “code” I want shown is the JSON object, since that is probably the closest you'll get to Scratchblocks in a textual/code-like format despite it not actually being real code; if editable, it will allow us advanced users to modify/hack a project faster than downloading, extracting, editing, replacing, and uploading.
.- SpyGuy9
-
Scratcher
100+ posts
Show True Code
I tried To do that, nothing downloaded. And if you inspect element, It won't let you see any code!Make it where you can have the choice of seeing the actual code for games instead of the code blocks.Go to the project editor (Look inside)
Hold shift and click “File” at the top right above the project name
Click “Save Project Summary”
Go to the .txt file for the project (it's wherever you saved it)
Open it
It will show variables, costumes, sound and then scripts.
thank you

Try viewing the code in the comments.
- --Awesome
-
Scratcher
59 posts
Show True Code
No support, sorry. Scratch is a site that teachers teach in school, and kids would easily get confused by that.
Last edited by --Awesome (Jan. 4, 2018 20:40:46)
- goldfish678
-
Scratcher
1000+ posts
Show True Code
Make it where you can have the choice of seeing the actual code for games instead of the code blocks.before I try to address this suggestion itself, here are some tips for the future:
- consider going further than single-sentence suggestions. while they are concise and get the point across, they leave no room for elaboration and explanation on why you think your suggestion would be vital and/or beneficial for Scratch.
- try to make it sound like it is truly a suggestion; make sure that one would feel like your statement is not imperative and forceful.
- avoid bias towards one type of project. there are many artists, music producers, animators, etc. etc. on scratch as well as game programmers.
now to the actual suggestion. this is definitely an interesting thought because as @Rumanti touched on (see post #3 on the first page), many websites similar to scratch have options like this. the problem here is that those websites were designed to be able to do that. scratch, on the other hand, is not. scratch doesn't provide direct equivalents for its code blocks–as @Rumanti also said in the same post, the functions you see on those other websites can't actually be run through an interpreter. they look like they're supposed to be the language, but they're still pseudo-code–just in text form. i suppose the scratch team could also do this, but first of all, what language would they base the text off of? i can't imagine they would have a great time mimicking actionscript so that it would be coherent for kids. doing the same thing with javascript, on the other hand, can basically just be whatever the heck you want to say with a couple parentheses and a semicolon slapped on the end, but it wouldn't exactly make sense to mimic javascript for a flash-based language. scratch 3, on the other hand, would be a different story, but there would still be problems. the reason that code.org can pull this off is that their functions are ridiculously simple. scratch would have some complications with that sort of thing–for example, the go to x: () y: () block. in javascript pseudo-code that might look something like this:
goTo(30, 50);
but then you'd have to explain that the numbers are seperated not because of a coordinate thing but because you're distinguishing one parameter from the other that are being input into the function and you'd also have to clarify that the parameters are (x,y). that's a lot of additional information for something that's as basic in concept as an “actual code” option.
if you still want something past the pseudo-code that scratch provides, i'd suggest converting the sb2 file of choice into a zip file and reading the json from there.
sincerely,
goldfish
- Discussion Forums
- » Suggestions
-
» Show True Code
















