ScratchData LogoScratchData
Back to BoyKetchup's profile

TomatoPaste (Scratch Coding Language) v0.1

BOBoyKetchup•Created December 10, 2015
TomatoPaste (Scratch Coding Language) v0.1
4
4
126 views
View on Scratch

Instructions

After you run your program, a copy-able version will pop up if you want to edit it. Press space to close it and enter a new program. PRESS SHIFT + TAB + ENTER TO STOP A PROGRAM (It is recommended to use the compiler linked below when coding) -All lines must end in semi-colons. -Double quotes "" surround all strings. -Curly brackets surround all code blocks. -Dollar signs appear before variable references. -Variables' values are accessed with JUST their name. -Invalid function names are skipped. Invalid variable names will cause an error. Line format: [function] [arguments]; (ignore square brackets) The result of all functions is stored in the variable "LastReturn". YOU CANNOT DIRECTLY MODIFY LastReturn! (If the stuff above makes no sense, keep reading) The following functions are available: Function | Arguments (optional are marked with []) | Description ---------------------------------------------------- if | Boolean, code block | Runs code only if boolean value is true. else | Code block | Runs code only if previously run function returned a true value (If statements do this if they receive a false value) var | Name (string), [value] | Creates a new variable and assigns its value. log | Value | Adds a value to the log (right side of screen). title | Title, version (string), author | Posts a title line at start. It is recommended to make this the very first line of your program. set | Variable reference, value | Sets the value of a variable. add | Value 1, value 2 | Adds two values. subtract | Value 1, value 2 | Subtracts two values. multiply | Value 1, value 2 | Multiplies two values. divide | Value 1, value 2 | Divides two values. mod | Value 1, value 2 | Gets the remainder of the division of two values. equals | Value 1, value 2 | Checks whether two values are equal. greater | Value 1, value 2 | Checks whether the first value is larger than the other. lesser | Value 1, value 2 | Checks whether the first value is smaller than the other. conc | String 1, String 2 | Joins two strings or values. input | [Message] | Asks the user for input. It also waits, so you can use it as a "Press any key to continue..." kind of thing. call | Code block, [function arguments...] | Runs a code block, including one stored in a variable, but the only variables it can access are the values passed to it (They are accessed as ARG1, ARG2, and so on). callTurbo | Code block, [function arguments...] | Does the same as call, but runs without screen refresh. return | Value | Sets the LastReturn variable to a value. while | Boolean variable reference, code block | Repeatedly runs the code block until the variable referenced is false or 0. wait | Time in seconds | Pauses the script for x seconds.

Description

TomatoPaste Version 0.1 ------------------------------------- Programming with the compiler is much easier! You can find it here: https://scratch.mit.edu/projects/91078037/ Ask any questions below, or share programs you have made in a comment. Sample programs: Title: Even or Odd? Code: title "Even or Odd?" "1.0" "BoyKetchup";input "Enter a number:";mod LastReturn 2;var "isOdd" LastReturn;if isOdd {log "Your number is odd.";};else {log "Your number is even.";}; Title: Simple AI Code: title "Simple AI" "1.0" "BoyKetchup";input "What's your name?";var "name" LastReturn;conc "Nice to meet you " name;conc LastReturn "!";log LastReturn;input "What is your favorite color?";conc LastReturn " is my favorite color too!";log LastReturn; Title: Square Printer Code: 10 "Square Printer" "1.0" "BoyKetchup";8 "repeat" {var "line" "";var "length" ARG1;while $length {conc line ARG2;set $line LastReturn;subtract length 1;set $length LastReturn;};return line;};7 repeat 25 "[]";8 "fullLine" LastReturn;9 fullLine;9 fullLine;7 repeat 6 "[]";8 "side" LastReturn;7 repeat 35 " ";20 side LastReturn;20 LastReturn side;8 "blankLine" LastReturn;8 "i" 5;5 $i {log blankLine;subtract i 1;set $i LastReturn;};9 fullLine;9 fullLine;

Project Details

Project ID91036416
CreatedDecember 10, 2015
Last ModifiedJanuary 15, 2017
SharedDecember 10, 2015
Visibilityvisible
CommentsAllowed