Discuss Scratch

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.

| My website | Using Geany | A Christian | Running Ubuntu MATE 14.04 with Flash 18.0 (release 0) | Search this with quotation marks on Google to view my posts: “ellipsepostpianolizard” (some posts may not show up) |

Moving on from Scratch? Learn Python/a scripting language (e.g Perl, JavaScript), then move on to a C derivative
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

iamunknown2
Scratcher
1000+ posts

Show True Code

Rumanti wrote:

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
For 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).

| My website | Using Geany | A Christian | Running Ubuntu MATE 14.04 with Flash 18.0 (release 0) | Search this with quotation marks on Google to view my posts: “ellipsepostpianolizard” (some posts may not show up) |

Moving on from Scratch? Learn Python/a scripting language (e.g Perl, JavaScript), then move on to a C derivative
CatsUnited
Scratcher
1000+ posts

Show True Code

iamunknown2 wrote:

To convert Scratch blocks to JavaScript wouldn't work very well.
Scratch scripts use JSON though.

cursed diglett | NINTENDO SWITCH II | Water Tier List (diet water is S tier) | You can install Limewire Pro with Limewire
| SCP-4526162 | The official home to Shef Kerbi News Network | Big things are coming this summer/winter | yeet™ | 9600+ posts

iamunknown2
Scratcher
1000+ posts

Show True Code

CatsUnited wrote:

iamunknown2 wrote:

To convert Scratch blocks to JavaScript wouldn't work very well.
Scratch scripts use JSON though.
JSON != JS
The JSON code is still in Scratch blocks format, and not in JS format.

| My website | Using Geany | A Christian | Running Ubuntu MATE 14.04 with Flash 18.0 (release 0) | Search this with quotation marks on Google to view my posts: “ellipsepostpianolizard” (some posts may not show up) |

Moving on from Scratch? Learn Python/a scripting language (e.g Perl, JavaScript), then move on to a C derivative
CatsUnited
Scratcher
1000+ posts

Show True Code

iamunknown2 wrote:

JSON != JS
The JSON code is still in Scratch blocks format, and not in JS format.
JSON.parse();
BTW, I don't support this suggestion.

cursed diglett | NINTENDO SWITCH II | Water Tier List (diet water is S tier) | You can install Limewire Pro with Limewire
| SCP-4526162 | The official home to Shef Kerbi News Network | Big things are coming this summer/winter | yeet™ | 9600+ posts

MushroomMan99
Scratcher
100+ posts

Show True Code

Rumanti wrote:

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
Scratch's drag and drop menu makes it easier than other programming languages.

when green flag clicked
if <(language) = [English ]> then

say [Everything is Awesome!] for (2) secs
end
if <(language) = [French ]> then

say [Tout est super-genial!] for (2) secs
end
if <(language) = [Italian ]> then

say [E meraviglioso!] for (2) secs
end
if <(language) = [Spanish ]> then

say [Todo es fabuloso!] for (2) secs
end
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.

ɴᴏᴡ ᴘʟᴀʏɪɴɢ: Despacito 2 (Feat: Lil Pump) ───────────⚪────── ◄◄⠀▐▐ ⠀►►⠀⠀ ⠀
Letsgopitt
Scratcher
500+ posts

Show True Code

CatsUnited wrote:

iamunknown2 wrote:

To convert Scratch blocks to JavaScript wouldn't work very well.
Scratch scripts use JSON though.
I thought Scratch used Actionscript. Are they the same thing?
stickfire-test
Scratcher
100+ posts

Show True Code

Letsgopitt wrote:

CatsUnited wrote:

iamunknown2 wrote:

To convert Scratch blocks to JavaScript wouldn't work very well.
Scratch scripts use JSON though.
I thought Scratch used Actionscript. Are they the same thing?
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.


Chibi-Matoran
Scratcher
1000+ posts

Show True Code

Rumanti wrote:

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
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.

If you see this signature while scrolling, you have been visited by ʎ++ haskal. Lazy evaluation, monads, function purity, lambdas, currying, partial application, algebraic data types, pattern matching, and typeclasses will come to you, but only if you comment, “Thanks, ʎ++ haskal” on my profile.

Cassian && ||
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.

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

Budderjohn wrote:

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.

What did the board say to the tire? “I'm bored!” “I'm tired” said the tire.
16 translations later…
What does the board say to the fence? I am pierced! I am tired said the fence.

elemnts2002
Scratcher
1 post

Show True Code

Puppers wrote:

Budderjohn wrote:

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

Zro716 wrote:

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.
Apparently, ToU doesn't allowed hacked projects .
SpyGuy9
Scratcher
100+ posts

Show True Code

elemnts2002 wrote:

Puppers wrote:

Budderjohn wrote:

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
I tried To do that, nothing downloaded. And if you inspect element, It won't let you see any code!

Try viewing the code in the comments.

When something is Important Enough, you do it even if the odds are not in your favor.

Elon Musk
I go by SGIX, SpyGuy, IX, or SpyGuy9.
--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)


Hi! I am –Awesome, but my name is Zach.
Feel free to check out my profile.
Have a wonderful day!
goldfish678
Scratcher
1000+ posts

Show True Code

Budderjohn wrote:

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



Where did time go?

Powered by DjangoBB

Standard | Mobile