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:
________________
________________
And here's the list:
__________________
__________________
__________________
__________________
__________________
Joe = turtle.Pen()
Joe.up
__________________
Joe = turtle.Pen()
Joe.color(0, 1, 0)
__________________
__________________
time.sleep(3)
__________________
pass
pass
__________________
pass
pass
__________________
pass
pass
__________________
pass
else:
pass
pass
__________________
while not Lorem_Ipsum == “dolor sit amet”:
time.sleep(0.01)
__________________
pass
pass
__________________
copy.copy(Lorem_Ipsum)
___________________
___________________
___________________
timerRunning = True
while timerRunning:
time.sleep(1)
timer += 1
___________________
___________________
___________________
10 - 10
10 * 10
10 / 10
___________________
return random.randint(10, 30)
___________________
10 == 10
10 > 10
____________________
3 or 4
not 5
____________________
____________________
len(“Lorem”)
____________________
round(4.32, 0)
____________________
____________________
____________________
____________________
____________________
del MyList
____________________
MyList = “Lorem Ipsum”
____________________
len(MyList)
“Lorem Ipsum” in MyList
_____________________
for listShow in MyList:
print(listShow)
os.system(“cls”)
_____________________
answer = input(“Hello ” + name)
MyList.append(answer)
_____________________
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 upimport 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) secsimport time
time.sleep(3)
__________________
repeat (12)for repeat in range(0, 12)
potato [Put your random block here]
end
pass
pass
__________________
foreverwhile True:
potato [Put your random block here]
end
pass
pass
__________________
if <(Lorem Ipsum) = [dolor sit amet]> thenif Lorem_Ipsum == “dolor sit amet”:
potato [Put your random block here]
end
pass
pass
__________________
if <(Lorem Ipsum) = [dolor sit amet]> thenif Lorem_Ipsum == “dolor sit amet”:
potato [Put your random block here]
else
potato [A different random block]
end
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]>while not Lorem_Ipsum == “dolor sit amet”:
potato [Put your random block here]
end
pass
pass
__________________
create clone of [Lorem Ipsum v]import copy
copy.copy(Lorem_Ipsum)
___________________
ask [Are you a potato?] and waitanswer = input(“Are you a potato?”)
___________________
reset timertimer = 0
___________________
run timerimport 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>>1 and 2
<<3> or <4>>
<not <5>>
3 or 4
not 5
____________________
(join [Lorem] [Ipsum])“Lorem” + “Ipsum”
____________________
(letter (4) of [Lorem])“Lorem”
(length of [Lorem])
len(“Lorem”)
____________________
((14) mod (3))14 % 3
(round (4.32))
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]MyList.append(“Lorem Ipsum”)
delete (3) of [MyList v]
del MyList
____________________
insert [Lorem Ipsum] at (3 v) of [MyList v]MyList.insert(2, “Lorem Ipsum”)
replace item (3 v) of [MyList v] with [Lorem Ipsum]
MyList = “Lorem Ipsum”
____________________
(item (3 v) of [MyList v] :: list)MyList
(length of [MyList v] :: list)
<[MyList v] contains [Lorem Ipsum] ?>
len(MyList)
“Lorem Ipsum” in MyList
_____________________
show list [MyList v]import os
hide list [MyList v]
for listShow in MyList:
print(listShow)
os.system(“cls”)
_____________________
define My(name)Functiondef MyFunction(name):
ask (join [Hello ] (name)) and wait
add (answer) to [MyList v]
answer = input(“Hello ” + name)
MyList.append(answer)
_____________________
Last edited by HappyBoulder2 (April 15, 2018 17:55:57)
- 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
For this block: Shouldn't “letter (4) of (Lorem Ipsum)” be “Lorem Ipsum”?
(letter (x) of [xxx])i just left it as “Lorem”. DEAL WITH IT
- 64yes
- Scratcher
67 posts
Scratch to Python
Don't just bump your own posts like this. Nice job anyway
- HappyBoulder2
- Scratcher
53 posts
Scratch to Python
But I want people to see it; this is supposed to be helpful. Don't just bump your own posts like this. Nice job anyway
- 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
No, it's more like HTML. BBcode is kinda like 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
I already have that.change [variable v] by (1)variable += 1
- HappyBoulder2
- Scratcher
53 posts
Scratch to Python
Thanks!define this forum
set [this forum's feedback v] to [awesome!!!]
Last edited by HappyBoulder2 (April 15, 2018 01:03:10)
- 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.
- HappyBoulder2
- Scratcher
53 posts
Scratch to Python
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.
Good job.forever
set [scratch v] to [ python ]
end