Scratch_Vision_Game_test_dup / blocks /reporter_blocks.json
prthm11's picture
Upload 176 files
abdc44e verified
{
"block_category": "Reporter Blocks",
"description": "Reporter blocks have rounded edges. Their purpose is to report values, which can be numbers or strings, and are designed to fit into input slots of other blocks.",
"blocks": [
{
"block_name": "(x position)",
"block_type": "Motion",
"op_code": "motion_xposition",
"block_shape": "Reporter Block",
"functionality": "Reports the current X-coordinate of the sprite.[NOTE: not used in stage/backdrops]",
"inputs": null,
"example_standalone": "x position",
"example_with_other_blocks": [
{
"script": "when green flag clicked\n say (x position) for (2) seconds\nend",
"explanation": "This script makes the sprite say its current X-coordinate for 2 seconds."
}
]
},
{
"block_name": "(y position)",
"block_type": "Motion",
"op_code": "motion_yposition",
"block_shape": "Reporter Block",
"functionality": "Reports the current Y coordinate of the sprite on the stage.[NOTE: not used in stage/backdrops]",
"inputs": null,
"example_standalone": "y position",
"example_with_other_blocks": [
{
"script": "set [worms v] to (y position)",
"explanation": "This script assigns the sprite's current Y position to the 'worms' variable."
}
]
},
{
"block_name": "(direction)",
"block_type": "Motion",
"op_code": "motion_direction",
"block_shape": "Reporter Block",
"functionality": "Reports the current direction of the sprite in degrees (0 = up, 90 = right, 180 = down, -90 = left).[NOTE: not used in stage/backdrops]",
"inputs": null,
"example_standalone": "direction",
"example_with_other_blocks": [
{
"script": "when green flag clicked\n say (direction) for (2) seconds\nend",
"explanation": "This script makes the sprite say its current direction in degrees for 2 seconds."
}
]
},
{
"block_name": "(costume ())",
"block_type": "Looks",
"op_code": "looks_costumenumbername",
"block_shape": "Reporter Block",
"functionality": "Reports the current costume's number or name.",
"inputs": [
{
"name": "NUMBER_NAME",
"type": "dropdown",
"options": [
"number",
"name"
]
}
],
"example_standalone": "costume [number v]",
"example_with_other_blocks": [
{
"script": "say join [I am costume ] (costume [name v])",
"explanation": "This script makes the sprite display its current costume name in a speech bubble."
}
]
},
{
"block_name": "(size)",
"block_type": "Looks",
"op_code": "looks_size",
"block_shape": "Reporter Block",
"functionality": "Reports the current size of the sprite as a percentage.",
"inputs": null,
"example_standalone": "size",
"example_with_other_blocks": [
{
"script": "set size to ( (size) + (10) )",
"explanation": "This script increases the sprite's size by 10% from its current size."
}
]
},
{
"block_name": "(backdrop ())",
"block_type": "Looks",
"op_code": "looks_backdropnumbername",
"block_shape": "Reporter Block",
"functionality": "Reports the current backdrop's number or name.",
"inputs": [
{
"name": "NUMBER_NAME",
"type": "dropdown",
"options": [
"number",
"name"
]
}
],
"example_standalone": "(backdrop [number v])",
"example_with_other_blocks": [
{
"script": "say join [Current backdrop: ] (backdrop [name v]) for (2) seconds",
"explanation": "This script makes the sprite say the name of the current stage backdrop for 2 seconds."
}
]
},
{
"block_name": "(volume)",
"block_type": "Sound",
"op_code": "sound_volume",
"block_shape": "Reporter Block",
"functionality": "Reports the current volume level of the sprite.",
"inputs": null,
"example_standalone": "volume",
"example_with_other_blocks": [
{
"script": "say join [Current volume: ] (volume)",
"explanation": "This script makes the sprite display its current volume level in a speech bubble."
}
]
},
{
"block_name": "(distance to ())",
"block_type": "Sensing",
"op_code": "sensing_distanceto",
"block_shape": "Reporter Block",
"functionality": "Reports the distance from the current sprite to the mouse-pointer or another specified sprite.",
"inputs": [
{
"name": "target",
"type": "dropdown",
"options": ["mouse-pointer", "Sprite1", "Sprite2", "...", "_edge_"]
}
],
"example_standalone": "distance to [mouse-pointer v]",
"example_with_other_blocks": [
{
"script": "if <(distance to [Sprite2 v]) < (50)> then\n say [Too close!]\nend",
"explanation": "This script makes the sprite say 'Too close!' if it is less than 50 steps away from 'Sprite2'."
}
]
},
{
"block_name": "(answer)",
"block_type": "Sensing",
"op_code": "sensing_answer",
"block_shape": "Reporter Block",
"functionality": "Holds the most recent text inputted using the 'Ask () and Wait' block.",
"inputs": null,
"example_standalone": "answer",
"example_with_other_blocks": [
{
"script": "ask [What is your name?] and wait\n say join [Hello ] (answer)",
"explanation": "This script prompts the user for their name and then uses the 'answer' block to incorporate their input into a greeting."
}
]
},
{
"block_name": "(mouse x)",
"block_type": "Sensing",
"op_code": "sensing_mousex",
"block_shape": "Reporter Block",
"functionality": "Reports the mouse-pointer’s current X position on the stage.",
"inputs": null,
"example_standalone": "mouse x",
"example_with_other_blocks": [
{
"script": "go to x: (mouse x) y: (mouse y)",
"explanation": "This script makes the sprite follow the mouse pointer's X and Y coordinates."
}
]
},
{
"block_name": "(mouse y)",
"block_type": "Sensing",
"op_code": "sensing_mousey",
"block_shape": "Reporter Block",
"functionality": "Reports the mouse-pointer’s current Y position on the stage.",
"inputs": null,
"example_standalone": "mouse y",
"example_with_other_blocks": [
{
"script": "if <(mouse y) < (0)> then\n say [Below center]",
"explanation": "This script makes the sprite say 'Below center' if the mouse pointer is in the lower half of the stage."
}
]
},
{
"block_name": "(loudness)",
"block_type": "Sensing",
"op_code": "sensing_loudness",
"block_shape": "Reporter Block",
"functionality": "Reports the loudness of noise received by a microphone on a scale of 0 to 100.",
"inputs": null,
"example_standalone": "loudness",
"example_with_other_blocks": [
{
"script": "when green flag clicked\n forever\n if <(loudness) > (30)> then\n start sound [pop v]\nend",
"explanation": "This script continuously checks the microphone loudness and plays a 'pop' sound if it exceeds 30."
}
]
},
{
"block_name": "(timer)",
"block_type": "Sensing",
"op_code": "sensing_timer",
"block_shape": "Reporter Block",
"functionality": "Reports the elapsed time since Scratch was launched or the timer was reset, increasing by 1 every second.",
"inputs": null,
"example_standalone": "timer",
"example_with_other_blocks": [
{
"script": "when green flag clicked\n reset timer\n wait (5) seconds\n say join [Time elapsed: ] (timer)",
"explanation": "This script resets the timer when the green flag is clicked, waits for 5 seconds, and then reports the elapsed time."
}
]
},
{
"block_name": "(() of ())",
"block_type": "Sensing",
"op_code": "sensing_of",
"block_shape": "Reporter Block",
"functionality": "Reports a specified value (e.g., x position, direction, costume number) of a specified sprite or the Stage to be accessed in current sprite or stage.",
"inputs": [
{
"name": "value to report",
"type": "dropdown",
"options": [
"x position",
"y position",
"direction",
"costume #",
"costume name",
"size",
"volume",
"backdrop #",
"backdrop name"
]
},
{
"name": "sprite/stage",
"type": "dropdown",
"options": ["Stage", "Sprite1", "Sprite2", "...", "_edge_"]
}
],
"example_standalone": "x position of [Sprite1 v]",
"example_with_other_blocks": [
{
"script": "set [other sprite X v] to ( (x position) of [Sprite2 v] )",
"explanation": "This script sets the 'other sprite X' variable to the current X-position of 'Sprite2'."
}
]
},
{
"block_name": "(current ())",
"block_type": "Sensing",
"op_code": "sensing_current",
"block_shape": "Reporter Block",
"functionality": "Reports the current local year, month, date, day of the week, hour, minutes, or seconds.",
"inputs": [
{
"name": "time unit",
"type": "dropdown",
"options": [
"year",
"month",
"date",
"day of week",
"hour",
"minute",
"second"
]
}
],
"example_standalone": "current [hour v]",
"example_with_other_blocks": [
{
"script": "say join [The current hour is ] (current [hour v])",
"explanation": "This script makes the sprite say the current hour."
}
]
},
{
"block_name": "(days since 2000)",
"block_type": "Sensing",
"op_code": "sensing_dayssince2000",
"block_shape": "Reporter Block",
"functionality": "Reports the number of days (and fractions of a day) since 00:00:00 UTC on January 1, 2000.",
"inputs": null,
"example_standalone": "days since 2000",
"example_with_other_blocks": [
{
"script": "say join [Days passed: ] (days since 2000)",
"explanation": "This script makes the sprite display the number of days that have passed since January 1, 2000."
}
]
},
{
"block_name": "(username)",
"block_type": "Sensing",
"op_code": "sensing_username",
"block_shape": "Reporter Block",
"functionality": "Reports the username of the user currently logged into Scratch. If no user is logged in, it reports nothing.",
"inputs": null,
"example_standalone": "username",
"example_with_other_blocks": [
{
"script": "say join [Hello, ] (username)",
"explanation": "This script makes the sprite greet the user by their Scratch username."
}
]
},
{
"block_name": "(() + ())",
"block_type": "operator",
"op_code": "operator_add",
"block_shape": "Reporter Block",
"functionality": "Adds two numerical values.",
"inputs": [
{
"name": "number1",
"type": "number"
},
{
"name": "number2",
"type": "number"
}
],
"example_standalone": "(5) + (3)",
"example_with_other_blocks": [
{
"script": "set [total v] to ( (number 1) + (number 2) )",
"explanation": "This script calculates the sum of 'number 1' and 'number 2' and stores the result in the 'total' variable."
}
]
},
{
"block_name": "(() - ())",
"block_type": "operator",
"op_code": "operator_subtract",
"block_shape": "Reporter Block",
"functionality": "Subtracts the second numerical value from the first.",
"inputs": [
{
"name": "number1",
"type": "number"
},
{
"name": "number2",
"type": "number"
}
],
"example_standalone": "((10) - (4))",
"example_with_other_blocks": [
{
"script": "set [difference v] to ( (number 1) - (number 2) )",
"explanation": "This script calculates the subtraction of 'number 2' from 'number 1' and stores the result in the 'difference' variable."
}
]
},
{
"block_name": "(() * ())",
"block_type": "operator",
"op_code": "operator_multiply",
"block_shape": "Reporter Block",
"functionality": "Multiplies two numerical values.",
"inputs": [
{
"name": "number1",
"type": "number"
},
{
"name": "number2",
"type": "number"
}
],
"example_standalone": "(6) * (7)",
"example_with_other_blocks": [
{
"script": "set [area v] to ( (length) * (width) )",
"explanation": "This script calculates the area by multiplying 'length' and 'width' variables and stores it in the 'area' variable."
}
]
},
{
"block_name": "(() / ())",
"block_type": "operator",
"op_code": "operator_divide",
"block_shape": "Reporter Block",
"functionality": "Divides the first numerical value by the second.",
"inputs": [
{
"name": "number1",
"type": "number"
},
{
"name": "number2",
"type": "number"
}
],
"example_standalone": "((20) / (5))",
"example_with_other_blocks": [
{
"script": "set [average v] to ( (total score) / (number of students) )",
"explanation": "This script calculates the average by dividing 'total score' by 'number of students' and stores it in the 'average' variable."
}
]
},
{
"block_name": "(pick random () to ())",
"block_type": "operator",
"op_code": "operator_random",
"block_shape": "Reporter Block",
"functionality": "Generates a random integer within a specified inclusive range.",
"inputs": [
{
"name": "min",
"type": "number"
},
{
"name": "max",
"type": "number"
}
],
"example_standalone": "(pick random (1) to (10))",
"example_with_other_blocks": [
{
"script": "go to x: (pick random -240 to 240) y: (pick random -180 to 180)",
"explanation": "This script moves the sprite to a random position on the stage."
}
]
},
{
"block_name": "(join ()())",
"block_type": "operator",
"op_code": "operator_join",
"block_shape": "Reporter Block",
"functionality": "Concatenates two strings or values into a single string.",
"inputs": [
{
"name": "string1",
"type": "string/number"
},
{
"name": "string2",
"type": "string/number"
}
],
"example_standalone": "(join [Hello ][World!])",
"example_with_other_blocks": [
{
"script": "say (join [Hello ][World!])",
"explanation": "This script makes the sprite display 'Hello World!' in a speech bubble by joining two string literals."
}
]
},
{
"block_name": "letter () of ()",
"block_type": "operator",
"op_code": "operator_letterof",
"block_shape": "Reporter Block",
"functionality": "Reports the character at a specific numerical position within a string.",
"inputs": [
{
"name": "index",
"type": "number"
},
{
"name": "text",
"type": "string"
}
],
"example_standalone": "(letter (1) of [apple])",
"example_with_other_blocks": [
{
"script": "say (letter (1) of [apple])",
"explanation": "This script makes the sprite display the first character of the string 'apple', which is 'a'."
}
]
},
{
"block_name": "(length of ())",
"block_type": "operator",
"op_code": "operator_length",
"block_shape": "Reporter Block",
"functionality": "Reports the total number of characters in a given string.",
"inputs": [
{
"name": "text",
"type": "string"
}
],
"example_standalone": "(length of [banana])",
"example_with_other_blocks": [
{
"script": "say (length of [banana])",
"explanation": "This script makes the sprite display the length of the string 'banana', which is 6."
}
]
},
{
"block_name": "(() mod ())",
"block_type": "operator",
"op_code": "operator_mod",
"block_shape": "Reporter Block",
"functionality": "Reports the remainder when the first number is divided by the second.",
"inputs": [
{
"name": "number1",
"type": "number"
},
{
"name": "number2",
"type": "number"
}
],
"example_standalone": "((10) mod (3))",
"example_with_other_blocks": [
{
"script": "if <([number v] mod (2) = (0))> then\n say [Even number]",
"explanation": "This script checks if a 'number' variable is even by checking if its remainder when divided by 2 is 0."
}
]
},
{
"block_name": "(round ())",
"block_type": "operator",
"op_code": "operator_round",
"block_shape": "Reporter Block",
"functionality": "Rounds a numerical value to the nearest integer.",
"inputs": [
{
"name": "number",
"type": "number"
}
],
"example_standalone": "(round (3.7))",
"example_with_other_blocks": [
{
"script": "set [rounded score v] to (round (score))",
"explanation": "This script rounds the 'score' variable to the nearest whole number and stores it in 'rounded score'."
}
]
},
{
"block_name": "(() of ())",
"block_type": "operator",
"op_code": "operator_mathop",
"block_shape": "Reporter Block",
"functionality": "Performs various mathematical functions (e.g., absolute value, square root, trigonometric functions).",
"inputs": [
{
"name": "function type",
"type": "dropdown",
"options": [
"abs",
"floor",
"ceiling",
"sqrt",
"sin",
"cos",
"tan",
"asin",
"acos",
"atan",
"ln",
"log",
"e ^",
"10 ^"
]
},
{
"name": "value",
"type": "number"
}
],
"example_standalone": "([sqrt v] of (25))",
"example_with_other_blocks": [
{
"script": "set [distance v] to ([sqrt v] of ( ( (x position) * (x position) ) + ( (y position) * (y position) ) ))",
"explanation": "This script calculates the distance from the origin (0,0) using the Pythagorean theorem and stores it in 'distance'."
}
]
},
{
"block_name": "[variable v]",
"block_type": "Data",
"op_code": "data_variable",
"block_shape": "Reporter Block",
"functionality": "Provides the current value stored in a variable.",
"inputs": [
{
"name": "variable name",
"type": "dropdown",
"options": ["my variable", "score", "..."]
}
],
"example_standalone": "[score v]",
"example_with_other_blocks": [
{
"script": "say ([score v]) for (2) seconds",
"explanation": "This script makes the sprite say the current value of the 'score' variable for 2 seconds."
}
]
},
{
"block_name": "[list v]",
"block_type": "Data",
"op_code": "data_list",
"block_shape": "Reporter Block",
"functionality": "Reports the entire content of a specified list. When clicked in the editor, it displays the list as a monitor.",
"inputs": [
{
"name": "list name",
"type": "dropdown",
"options": ["my list", "list2", "..."]
}
],
"example_standalone": "[my list v]",
"example_with_other_blocks": [
{
"script": "say ([my list v]) ",
"explanation": "This script makes the sprite say all the contents of 'my list'."
}
]
},
{
"block_name": "(item (2) of [myList v])",
"block_type": "Data",
"op_code": "data_itemoflist",
"block_shape": "Reporter Block",
"functionality": "Reports the item located at a specific position in a list.",
"inputs": [
{
"name": "index/option",
"type": "number or dropdown",
"options": [
"last",
"random"
]
},
{
"name": "list name",
"type": "dropdown",
"options": ["shopping list", "my list", "..."]
}
],
"example_standalone": "item (1) of [shopping list v]",
"example_with_other_blocks": [
{
"script": "say (item (2) of [myList v]) for 2 seconds ",
"explanation": "This script makes the sprite display the first item from the 'shopping list'."
}
]
},
{
"block_name": "(length of [myList v])",
"block_type": "Data",
"op_code": "data_lengthoflist",
"block_shape": "Reporter Block",
"functionality": "Provides the total number of items contained in a list.",
"inputs": [
{
"name": "list name",
"type": "dropdown",
"options": ["my list", "shopping list", "..."]
}
],
"example_standalone": "(length of [myList v])",
"example_with_other_blocks": [
{
"script": "say join (length of [shopping list v]) [ items in the list.]",
"explanation": "This script makes the sprite display the total number of items currently in the 'shopping list'."
}
]
},
{
"block_name": "(item # of [Dog] in [myList v])",
"block_type": "Data",
"op_code": "data_itemnumoflist",
"block_shape": "Reporter Block",
"functionality": "Reports the index number of the first occurrence of a specified item in a list. If the item is not found, it reports 0.",
"inputs": [
{
"name": "item",
"type": "string/number"
},
{
"name": "list name",
"type": "dropdown",
"options": ["my list", "shopping list", "..."]
}
],
"example_standalone": "(item # of [apple] in [shopping list v])",
"example_with_other_blocks": [
{
"script": "if <(item # of [Dog] in [myList v])> (0)> then\n say join [Dog found at position ] (item # of [Dog] in [my list v])",
"explanation": "This script checks if 'banana' is in 'my list' and, if so, reports its position."
}
]
}
]
}