Spaces:
Sleeping
Sleeping
File size: 24,199 Bytes
3abfe5a |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 |
{
"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) 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",
"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",
"example_with_other_blocks": [
{
"script": "say (score) for (2) seconds",
"explanation": "This script makes the sprite say the current value of the 'score' variable for 2 seconds."
}
]
},
{
"block_name": "list",
"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",
"example_with_other_blocks": [
{
"script": "say (my list)",
"explanation": "This script makes the sprite say all the contents of 'my list'."
}
]
},
{
"block_name": "item () of ()",
"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 (1) of [shopping list v]",
"explanation": "This script makes the sprite display the first item from the 'shopping list'."
}
]
},
{
"block_name": "length of () (list)",
"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 [my list 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 () in ()",
"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 [banana] in [my list v]) > (0)> then\n say join [Banana found at position ] (item # of [banana] in [my list v])",
"explanation": "This script checks if 'banana' is in 'my list' and, if so, reports its position."
}
]
}
]
} |