Discuss Scratch

HappyBoulder2
Scratcher
53 posts

Scratch to Python

For anyone who might be interested, I'm making a “translation dictionary” between Scratch and Python 3. If you know Scratch and Python 3, and have suggestions that aren't already here, or if you have any questions, put it in a post here. (For the import commands and object assignment, you only have to do it once per program, at the beginning)
Template:
________________
potato [Put your random block here]
pass
________________




And here's the list:
__________________
say [Lorem Ipsum] for (2) secs
import time
import os
print("Lorem Ipsum")
time.sleep(2)
os.system("cls")
__________________
say [Lorem Ipsum dolor sit amet]
print("Lorem Ipsum dolor sit amet")
__________________
clear
import turtle
Joe = turtle.Pen()
Joe.clear
__________________
pen down
import turtle
Joe = turtle.Pen()
Joe.down
__________________
pen up
import turtle
Joe = turtle.Pen()
Joe.up
__________________
set pen color to [#00FF00]
import turtle
Joe = turtle.Pen()
Joe.color(0, 1, 0)
__________________
when green flag clicked
(nonexistent lol)
__________________
wait (3) secs
import time
time.sleep(3)
__________________
repeat (12)
potato [Put your random block here]
end
for repeat in range(0, 12)
pass
pass
__________________
forever
potato [Put your random block here]
end
while True:
pass
pass
__________________
if <(Lorem Ipsum) = [dolor sit amet]> then
potato [Put your random block here]
end
if Lorem_Ipsum == “dolor sit amet”:
pass
pass
__________________
if <(Lorem Ipsum) = [dolor sit amet]> then 
potato [Put your random block here]
else
potato [A different random block]
end
if Lorem_Ipsum == “dolor sit amet”:
pass
else:
pass
pass
__________________
wait until <(Lorem Ipsum) = [dolor sit amet]>
import time
while not Lorem_Ipsum == “dolor sit amet”:
time.sleep(0.01)
__________________
repeat until <(Lorem Ipsum) = [dolor sit amet]>
potato [Put your random block here]
end
while not Lorem_Ipsum == “dolor sit amet”:
pass
pass
__________________
create clone of [Lorem Ipsum v]
import copy
copy.copy(Lorem_Ipsum)
___________________
ask [Are you a potato?] and wait
answer = input(“Are you a potato?”)
___________________
reset timer
timer = 0
___________________
run timer
import time
timerRunning = True
while timerRunning:
time.sleep(1)
timer += 1
___________________
([dolor sit amet v] of [Lorem Ipsum v])
Lorem_Ipsum.dolor_sit_amet
___________________
(days since 2000)
return (gmtime / 86400) - 10950
___________________
((10) + (10))
((10) - (10))
((10) * (10))
((10) / (10))
10 + 10
10 - 10
10 * 10
10 / 10
___________________
(pick random (10) to (30))
import random
return random.randint(10, 30)
___________________
<[10] < [10]>
<[10] = [10]>
<[10] > [10]>
10 < 10
10 == 10
10 > 10
____________________
<<1> and <2>>
<<3> or <4>>
<not <5>>
1 and 2
3 or 4
not 5
____________________
(join [Lorem] [Ipsum])
“Lorem” + “Ipsum”
____________________
(letter (4) of [Lorem])
(length of [Lorem])
“Lorem”
len(“Lorem”)
____________________
((14) mod (3))
(round (4.32))
14 % 3
round(4.32, 0)
____________________
(Lorem Ipsum)
Lorem_Ipsum
____________________
set [Lorem Ipsum v] to [0]
Lorem_Ipsum = 0
____________________
change [Lorem Ipsum v] by (1)
Lorem_Ipsum += 1
____________________
(MyList :: list)
MyList
____________________
add [Lorem Ipsum] to [MyList v]
delete (3) of [MyList v]
MyList.append(“Lorem Ipsum”)
del MyList
____________________
insert [Lorem Ipsum] at (3 v) of [MyList v]
replace item (3 v) of [MyList v] with [Lorem Ipsum]
MyList.insert(2, “Lorem Ipsum”)
MyList = “Lorem Ipsum”
____________________
(item (3 v) of [MyList v] :: list)
(length of [MyList v] :: list)
<[MyList v] contains [Lorem Ipsum] ?>
MyList
len(MyList)
“Lorem Ipsum” in MyList
_____________________
show list [MyList v]
hide list [MyList v]
import os
for listShow in MyList:
print(listShow)
os.system(“cls”)
_____________________
define My(name)Function
ask (join [Hello ] (name)) and wait
add (answer) to [MyList v]
def MyFunction(name):
answer = input(“Hello ” + name)
MyList.append(answer)
_____________________

Last edited by HappyBoulder2 (April 15, 2018 17:55:57)

HappyBoulder2
Scratcher
53 posts

Scratch to Python

HappyBoulder2
Scratcher
53 posts

Scratch to Python

DaEpikDude
Scratcher
1000+ posts

Scratch to Python

Shouldn't “letter (4) of (Lorem Ipsum)” be “Lorem Ipsum”?

And all the world over, each nation's the same,
They've simply no notion of playing the game.
They argue with umpires, they cheer when they've won,
And they practice beforehand, which ruins the fun!
HappyBoulder2
Scratcher
53 posts

Scratch to Python

DaEpikDude wrote:

Shouldn't “letter (4) of (Lorem Ipsum)” be “Lorem Ipsum”?
For this block:
(letter (x) of [xxx])
i just left it as “Lorem”. DEAL WITH IT
HappyBoulder2
Scratcher
53 posts

Scratch to Python

64yes
Scratcher
67 posts

Scratch to Python

Don't just bump your own posts like this. Nice job anyway

*insert witty quote*

Go listen to my music
HappyBoulder2
Scratcher
53 posts

Scratch to Python

64yes wrote:

Don't just bump your own posts like this. Nice job anyway
But I want people to see it; this is supposed to be helpful.
HappyBoulder2
Scratcher
53 posts

Scratch to Python

owlannaelsa
Scratcher
1000+ posts

Scratch to Python

BBcode is kinda like Python

IMPORTANT: do not stalk me. just because im active somewhere doesnt mean that you should stalk me to that place. please, its VERY annoying.
HappyBoulder2
Scratcher
53 posts

Scratch to Python

owlannaelsa wrote:

BBcode is kinda like Python
No, it's more like HTML.
HappyBoulder2
Scratcher
53 posts

Scratch to Python

-ShadowOfThePast-
Scratcher
100+ posts

Scratch to Python

change [variable v] by (1)

variable += 1










Hello.
aceacerockscool
Scratcher
11 posts

Scratch to Python

define this forum
set [this forum's feedback v] to [awesome!!!]
HappyBoulder2
Scratcher
53 posts

Scratch to Python

-ShadowOfThePast- wrote:

change [variable v] by (1)

variable += 1
I already have that.
HappyBoulder2
Scratcher
53 posts

Scratch to Python

aceacerockscool wrote:

define this forum
set [this forum's feedback v] to [awesome!!!]
Thanks!

Last edited by HappyBoulder2 (April 15, 2018 01:03:10)

HappyBoulder2
Scratcher
53 posts

Scratch to Python

aceacerockscool
Scratcher
11 posts

Scratch to Python

Basically, I've heard about block based Python.. Is it easilly available? If so then please end me the link.
M_cat
Scratcher
2 posts

Scratch to Python

forever
set [scratch v] to [ python ]
end
HappyBoulder2
Scratcher
53 posts

Scratch to Python

aceacerockscool wrote:

Basically, I've heard about block based Python.. Is it easilly available? If so then please end me the link.
In this site you can make online programs, and one of the options is “Blocks”, which might be Python-based. I'd just recommend learning proper Python, though, like in the first post.

M_cat wrote:

forever
set [scratch v] to [ python ]
end
Good job.

Powered by DjangoBB