Discuss Scratch

CurtisW
Scratcher
49 posts

Scratch to Python using Snap! 4.0

If anyone hasn't tried Snap! 4.0, I think it is really great.
It's almost like upgraded Scratch, and you can do many more things like… Scratch to Python!

If you go to http://snap.berkeley.edu/snapsource/snap.html and open the Example file called Codification, you can create a simple program in Snap! and drag and drop the script into the variable ‘script’. Then run this block and your variable will be set to whatever you drag-dropped.

At the bottom there is a block called ‘Map to python’ with some other blocks attached, and you can run that block and it will convert your scratch to Python! You can see the results in the Stage and export the ‘Code’ variable and run it on python!

Very neat.

PROJECTS
=========================================================================================

• Fighting Game Engine Lead (v0.3): Studio, https://scratch.mit.edu/studios/3682087/ | Collab, https://scratch.mit.edu/discuss/topic/233470/
• Top-down RPG Engine: Studio, https://scratch.mit.edu/studios/4107006/ | Thread, https://scratch.mit.edu/discuss/topic/266044
=========================================================================================
The_Grits
Scratcher
1000+ posts

Scratch to Python using Snap! 4.0

Sounds cool! I haven't used it, but I might in the future! (I knew that Snap! existed, I just didn't know that it had the Scratch to Python feature.)


__init__
Scratcher
1000+ posts

Scratch to Python using Snap! 4.0

Sounds pretty neat! I'll test it out.
Starkader
New to Scratch
1 post

Scratch to Python using Snap! 4.0

I cant get snap for my operating system(linux)
WooHooBoy
Scratcher
1000+ posts

Scratch to Python using Snap! 4.0

Starkader wrote:

I cant get snap for my operating system(linux)
Please don't necropost.

considered harmful
liam48D
Scratcher
1000+ posts

Scratch to Python using Snap! 4.0

Starkader wrote:

I cant get snap for my operating system(linux)
What web browser are you using? Please click on the globe button in the reply box. It'll say something like “My browser / operating system: MacOS Macintosh X 10.5.0, Chrome 17, Flash 11.0 (release 0).”

It's an online program, by the way. Click here to run it.

202e-202e-202e-202e-202e UNI-CODE~~~~~
ChocolatePi
Scratcher
1000+ posts

Scratch to Python using Snap! 4.0

Starkader wrote:

I cant get snap for my operating system(linux)
I'd just like to interject for a moment. What you're referring to as Linux, is in fact, GNU/Linux, or as I've recently taken to calling it, GNU plus Linux. Linux is not an operating system unto itself, but rather another free component of a fully functioning GNU system made useful by the GNU corelibs, shell utilities and vital system components comprising a full OS as defined by POSIX.

Many computer users run a modified version of the GNU system every day, without realizing it. Through a peculiar turn of events, the version of GNU which is widely used today is often called “Linux”, and many of its users are not aware that it is basically the GNU system, developed by the GNU Project.

There really is a Linux, and these people are using it, but it is just a part of the system they use. Linux is the kernel: the program in the system that allocates the machine's resources to the other programs that you run. The kernel is an essential part of an operating system, but useless by itself; it can only function in the context of a complete operating system. Linux is normally used in combination with the GNU operating system: the whole system is basically GNU with Linux added, or GNU/Linux. All the so-called “Linux” distributions are really distributions of GNU/Linux.
OSimulators
Scratcher
52 posts

Scratch to Python using Snap! 4.0

CurtisW Wrote:
f anyone hasn't tried Snap! 4.0, I think it is really great.
It's almost like upgraded Scratch, and you can do many more things like… Scratch to Python!

If you go to http://snap.berkeley.edu/snapsource/snap.html and open the Example file called Codification, you can create a simple program in Snap! and drag and drop the script into the variable ‘script’. Then run this block and your variable will be set to whatever you drag-dropped.

At the bottom there is a block called ‘Map to python’ with some other blocks attached, and you can run that block and it will convert your scratch to Python! You can see the results in the Stage and export the ‘Code’ variable and run it on python!

Very neat.
How do you do the scratch to python thing?

This signature hasn't gotten eaten by kumquats yet. But, I've got a pretty good script to stop them vv

when green flag clicked
add (5000) soldiers to [great anti-kumquat army v] ::control

when [great anti kumquat army v] attacked by [kumquats v] ::hat events
send (5000) soldiers to [battle v] from [great anti-kumquat army v] ::control
fight ::motion
if <won fight ::motion> then
say [hurrah!]
times [great anti-kumquat army v] size by (2) ::control
else
say[oops..]
stop [all v]
Jonathan50
Scratcher
1000+ posts

Scratch to Python using Snap! 4.0

OSimulators wrote:

CurtisW Wrote:
f anyone hasn't tried Snap! 4.0, I think it is really great.
It's almost like upgraded Scratch, and you can do many more things like… Scratch to Python!

If you go to http://snap.berkeley.edu/snapsource/snap.html and open the Example file called Codification, you can create a simple program in Snap! and drag and drop the script into the variable ‘script’. Then run this block and your variable will be set to whatever you drag-dropped.

At the bottom there is a block called ‘Map to python’ with some other blocks attached, and you can run that block and it will convert your scratch to Python! You can see the results in the Stage and export the ‘Code’ variable and run it on python!

Very neat.
How do you do the scratch to python thing?
Read the post. It explains how.
edmond301
Scratcher
5 posts

Scratch to Python using Snap! 4.0

Oh! Thank you! That might be helpful in the future…
Bryan007
Scratcher
100+ posts

Scratch to Python using Snap! 4.0

Starkader wrote:

I can't get snap for my operating system(Linux)
Browser Requirements

Browser Minimum
Version
Required Additional Notes
Chrome 43 Chrome is currently the recommended browser for Snap!
Safari 8.4
Firefox 38
Edge 12
Opera 32
IE 11

might be the browser problem
here is my browser version
My browser / operating system: Windows NT 10.0, Chrome 52.0.2743.116, Flash 22.0 (release 0)

If you ever see an evil kumquat, Always remember that kumquats are fruits and therefore, can't eat your signature

If you want a follower…


And #Bring_It_Back

Bryan007
Scratcher
100+ posts

Scratch to Python using Snap! 4.0

https://scratch.mit.edu/discuss/topic/27730/
https://scratch.mit.edu/discuss/topic/56444/

Last edited by Bryan007 (Aug. 20, 2016 19:12:10)


If you ever see an evil kumquat, Always remember that kumquats are fruits and therefore, can't eat your signature

If you want a follower…


And #Bring_It_Back

IcyCoder
Scratcher
1000+ posts

Scratch to Python using Snap! 4.0

Do not necro post thanks!

Because JS is the future (echos) future future futur futu fut fu f
edward789121
Scratcher
500+ posts

Scratch to Python using Snap! 4.0

Cool!

PLEASE, IN EVERY ONE OF YOUR POSTS, MAKE IT WELL THOUGT OUT AND FOLLOW THE STICKYS. JUST LIKE WHAT YOUR MOM SAYS, SAY SOMETHING NICE OR DON'T SAY ANYTHING.
my website | my scratch mod, PuzzlePiece | my shop | (“Python” == “easy”) | | Google broke! | modshare.futuresight.org | intforums.com | tbgforums.com | forums.thegt.org | Donate rice to the starving for free! | View all my posts, google style.
My super Mario run id: 3706-5585-2845
HaloLegoFan
Scratcher
20 posts

Scratch to Python using Snap! 4.0

I tried it and i can't find out how to do it pls make a video on how to do it pls.
ArchMan155
Scratcher
4 posts

Scratch to Python using Snap! 4.0

Where is the scratch to python button
card100
Scratcher
1000+ posts

Scratch to Python using Snap! 4.0

ArchMan155 wrote:

Where is the scratch to python button
Look in the top menus

-card100



Search all posts by me by searching on Google:
as;dflasdfpa98qweryhasdfvpiajnsdfvoaphsdnfajo
4yl1n
Scratcher
10 posts

Scratch to Python using Snap! 4.0

I can't find the Explore file.






4yl1n
MCShazam
New to Scratch
1 post

Scratch to Python using Snap! 4.0

Ok - so I checked this out - you should know:

1) the Scratch to Python, Scratch to C, etc. are pretty limited converters. They are are only built to convert blocks that operate on numbers and operations. Anything involving sound or graphics is beyond it's capability.

2) it is not button to convert - you need to open the file “Codification” from the examples menu, then read the comments in the scripts to figure out how to do a conversion, basically this:
* Find the block that says set script to { }
* stick your code inside the grey { }
* run this block (by double clicking)
* run the block that starts with Map to Python (or Map to C etc)
It will then show the equivalent code in the display window. As mentioned - anything involving graphics or sound or sensors etc won't work, just calculations.

winshare
Scratcher
2 posts

Scratch to Python using Snap! 4.0

my_var = 10

a = True
b = False

my_int = 7
my_int = 3
print (my_int)

spam = True
eggs = False

mysterious_variable = 42

#hweoto3rhq3ph

“”“”skngknthuthotohot
trsjsdjyjsjdh 6ehyj ytysr“”"

count_to = 5
addition = 5 + 0
subtraction = 10 - 5
print (count_to)

eggs = 28
print (eggs)

eggs = 2**8
print (eggs)

eggs = 6 ** 3 - 116
print (eggs)

spam = 4 % 3
print spam

Powered by DjangoBB

Standard | Mobile