Funny programming language in snap! (Part 3)

yeah

try start

break then if error //error reports if the command isn't recognized or the error

end

huh?

catch errors

anyway after the user writes the code, instead of a run button, we should just have the command

run

I think you guys have decided on the syntax, but how about actually coding it?

Wiki is the most replyed.

Technically it's not, the Among Us topics have like 5 parts to them, which means they're well over 100 more posts than the wiki topic.
The wiki topic is only the most replied because Administrative Categories doesn't have the 100 replies system.

Can anybody tell me the List syntax, I need it.

There isn't really a set-in-stone (agreed upon) syntax for lists afaik, but here are some suggestions I remember:

("item1",
 "item2",
 ("item1-nested",
  "item2-nested"))
["item1", "item2", ["item1-nested", "item2-nested"]]
{
"item1"
"item2"
{
"item1-nested"
"item2-nested"
}
}

i use

(item1, item2)

I like the second one.

Example
display text(what the user sees):

bagItems = ["Item 1", "Item 2",  pokemon = ["Charmander", "Pikachu"]]

Blocks(The Code translated to snap):

!

Also please forgive me because I keep using Pokemon as an example.

it's fine :slight_smile:

It's just that

  1. I like pokemon
  2. It is really practical for listing things instead of using Item 1, Item 2.(I might use Item 1, Item 2 sometimes.)

FizzBuzz program written in ESL:

create script variable "i"
repeat [[
change "i" by 1
if ((([i] mod 5) = 0) and (([i] mod 3) = 0))[[
display "FizzBuzz"
wait for 0.5 seconds
]] else [[
if (([i] mod 3) = 0)[[
display "Fizz"
wait for 0.5 seconds
]] else [[
if (([i] mod 5) = 0)[[
display "Buzz"
wait for 0.5 seconds
]] else [[
display i
]]]] for 100 times

Do not forget to put Indents(preferablly 4 spaces)

create script variable "i"
repeat [[
    change "i"
    if ((([i] mod 5) = 0) and (([i] mod 3) = 0))[[
        display "FizzBuzz"
        wait for 0.5 seconds
    ]] else [[
        if (([i] mod 3) = 0)[[
          display "Fizz"
        wait for 0.5 seconds
    ]] else [[
         if (([i] mod 5) = 0)[[
            display "Buzz"
            wait for 0.5 seconds
    ]] else [[
     display i
]]]] for 100 times

(yes I do know it looks like python)

Yikes, it's not very easy to read, either, even with the indents...

Also, If you want to make an variable for an object, do this.

create (OBJECT NAME) variable "i"

again, loops use { and }, also there is no need for all those parentheses, but you should be able to do it if you want.

Easy Read format:

make a variable called "x" for script -- the "x" variable is null currently
change "x" to 0
repeat this 100 times {
    change [x] to [x]+1 -- change by 1
    if [x] mod 5 = 0 and I mod 3 = 0 then{
        display "FizzBuzz"
    if not then{
         if [x] mod 3 then{
             display "Fizz"
    if not that then{
        if [x] mod 5 then{
            display "Buzz"
   if not then{
        display(x)

Is it any more readable?