Discuss Scratch
- Discussion Forums
- » Project Save & Level Codes
- » demo like when ChatGPT gives code to you do it here.
- Turbo-Code1000
-
Scratcher
29 posts
demo like when ChatGPT gives code to you do it here.
an example is
Here is the code setup for a 10x10 grid using a single cloned sprite, integrated with your existing save-code list.
Make sure you create the variable My Index and check the box for “For this sprite only”. All other variables can be “For all sprites”.define Get Points for ID (Block ID)
if <(Block ID) = [1]> then
set [Checked Point Value v] to (1)
else
if <(Block ID) = [2]> then
set [Checked Point Value v] to (10)
else
set [Checked Point Value v] to (0)
end
end
define Check Neighbor Offset (offset)
set [Target Index v] to ((My Index) + (offset))
if <<(Target Index) > [0]> and <(Target Index) < [101]>> then
Get Points for ID (item (Target Index) of [Save List v])
if <(Block Type) = [black]> then
change [Neighbor Sum v] by (Checked Point Value)
end
if <<(Block Type) = [orange]> and <(Checked Point Value) > [0]>> then
set [Neighbor Product v] to ((Neighbor Product) * (Checked Point Value))
set [Found Nearby Blocks v] to [true]
end
end
when I start as a clone
set [My Index v] to ((Grid X) + (((Grid Y) - (1)) * (10)))
replace item (My Index) of [Save List v] with (My ID)
wait (0) secs
if <(Block Type) = [normal]> then
change [Total Score v] by (1)
end
if <(Block Type) = [pink]> then
change [Total Score v] by (10)
end
if <(Block Type) = [black]> then
set [Neighbor Sum v] to (0)
Check Neighbor Offset (-11)
Check Neighbor Offset (-10)
Check Neighbor Offset (-9)
Check Neighbor Offset (-1)
Check Neighbor Offset (1)
Check Neighbor Offset (9)
Check Neighbor Offset (10)
Check Neighbor Offset (11)
change [Total Score v] by (Neighbor Sum)
end
if <(Block Type) = [orange]> then
set [Neighbor Product v] to (1)
set [Found Nearby Blocks v] to [false]
Check Neighbor Offset (-11)
Check Neighbor Offset (-10)
Check Neighbor Offset (-9)
Check Neighbor Offset (-1)
Check Neighbor Offset (1)
Check Neighbor Offset (9)
Check Neighbor Offset (10)
Check Neighbor Offset (11)
if <(Found Nearby Blocks) = [true]> then
change [Total Score v] by (Neighbor Product)
end
end
- Internetgirl2400
-
Scratcher
3 posts
demo like when ChatGPT gives code to you do it here.
Hello, I want to participate in the scratch mentor program , I'm 10 years and my dad said ok
- Turbo-Code1000
-
Scratcher
29 posts
demo like when ChatGPT gives code to you do it here.
Hello, I want to participate in the scratch mentor program , I'm 10 years and my dad said okWhat?
- Discussion Forums
- » Project Save & Level Codes
-
» demo like when ChatGPT gives code to you do it here.