How to program in this: It´s like Scratch (blocks,scripts etc.) except each block is written as text. Blocks are divided by the combination af characters ¤@ Example: clear¤@hide¤@stamp¤@ Means: First do the block CLEAR, then HIDE and STAMP. List of blocks and their code names: See Notes and Credits. However, blocks have operators written in them. So a block that has no operators (e.g. stamp) is like this: stamp¤#¤@ The combination ¤# means that the block name ends and operators are written (here, there aren´t any, so the block ends). A block with more operators (set x:0 y:0) setps¤#0¤#0¤#¤@ However, in front of every operator that is a number (and not a variable etc.), there´s written ¤n (so that when you use a variable "name", it knows that you just want "name" as text and not as the value of the variable). So, setps¤#¤n0¤#¤n0¤#¤@ To end a script, put in !¤@. To end a sprite, put in ?¤@. There´s a maximum of 1 sprite and 16 scripts by now. A simple program: setps¤#¤n0¤#¤n0¤#¤@ Go to x:0 y:0 pendw¤#¤@ Pen down clear¤#¤@ Clear move¤#¤n10¤#¤@ Move 10 steps stamp¤#¤@ Stamp !¤@ End of script ?¤@ End of sprite Cycles (forever, repeat, if, etc.): Simply put them in as two blocks: e.g. repet1 (start of repeat) and repet2 (end of repeat). Example: clear¤#¤@ Clear pendw¤#¤@ Pen down forvr1¤#¤@ Forever move¤#¤n50¤#¤@ Move 50 steps trnr¤#¤n100.1¤#¤@ Turn 100.1 degrees forvr2¤#¤@ End forever !¤@ End script ?¤@ End sprite Variables: Press V for buttons to add and delete variables and lists and see variables you are currently using and their corresponding values. To use a variable in an operator, start it with ¤v, not ¤n. Example: setps¤#¤n0¤#¤n0¤#¤@ Go to x:0 y:0 pendw¤#¤@ Pen down stvar¤nTurn¤#¤n0¤#¤@ Set variable "Turn" to 0 forvr1¤#¤@ Forever move¤#¤n5¤#¤@ Move 5 steps trnr¤#¤vTurn¤#¤@ Turn (the variable "Turn") steps chvar¤#¤nTurn¤#¤n1¤#¤@ Change variable "Turn" by 1 forvr2¤#¤@ End forever !¤@ End 1.script forvr1¤#¤@ Forever wait¤#¤n3¤#¤@ Wait 3 seconds clear¤#¤@ Clear forvr2¤#¤@ End forever !¤@ End 2.script ?¤@ End sprite "Position x" etc. Use ¤i when using these as operators. ¤iposx = position x Combined operators (e.g. 1+3): Start them with ¤c. Example of an operator: ¤c15¤n5¤n/¤s7¤n+¤sX1¤v=¤s This means: "Does ((15/5)+7) equal the variable X1?" How it works: After ¤c, there´s (I divided the oprator for it to be clearer): 15¤n 15 5¤n 5 /¤s / 7¤n 7 +¤s + X1¤v The variable "X1" =¤s So: 15 5 / 7 + X1 = How can you arrive here? You start with (15/5) and turn it into 15 5 / by putting the operator (division) after the number(s) it combines. Then, you put this into parentheses (15 5 /) And take it as one thing, so (15 5 /) 7 + Then, parenthesise this as well, ((15 5 /) 7 +) And take = as a function like +-*/. ((15 5 /) 7 +) X1 = And remove all parentheses: 15 5 / 7 + X1 = Some operators "combine" just 1 number (e.g.sqrt). Custom blocks without numbers in them: You put the block definition after the sprite end. Example: move¤#¤n10¤#¤@ Move 10 steps cusbl¤#¤njump¤#¤n¤#¤@ Run the custom block "jump" !¤@ End script ?¤@ End sprite def1¤¤#¤@ Define block "jump" as: chngy¤#¤n10¤#¤@ Change y by 10 wait¤#¤n1¤#¤@ Wait 1 second chngy¤#¤n-10¤#¤@ Change y by -10 def2¤#¤@ End block definition Note: The block cusbl¤#¤njump¤#¤n¤#¤@ has an empty operator (¤n and nothing), meaning that the block has no numbers in it. Custom blocks can have other custom blocks as a part of their definition. Continuation: Notes and credits
This program asks you to put in (programming) code and runs it. It´s basically Scratch, only written as text and not blocks. This is a demo of a WAY larger project I worked on for several months. Because of graphical issues it was ended. V opens/closes buttons for adding and removing lists. Lists and help: Inputs with choices (e.g. Key space pressed?): ¤ipress¤mspace¤# First the name of the input (press), then the choice (space). If else: Simply use the block if1 to start the if else cycle, if2 for the dividing between if and else, and if3 to end the cycle. Example: if1¤#¤ipress¤mup¤#¤@ If "up arrow" is pressed chngy¤#¤n10¤#¤@ Change y by 10 if2¤#¤@ Else chngy¤#¤n-10¤#¤@ Change y by -10 if3¤#¤@ End if else !¤@ End script ?¤@ End sprite If you read this sentence, please comment "692841" and I´ll give you a waffle for reading through all the notes! Thanks. List of blocks and their code names: Move ___ steps move Turn ___ degrees clockwise trnr Turn ___ degrees counterclockwise trnl Point in direction ___ setdr Go to x:___ y:___ setps Glide ___ secs to x:___ y:___ glide Change x by___ chngx Change y by ___ chngy Set x to ___ setx Set y to ___ sety If on edge, bounce knbk Set rotation style to just left right strlr Set rotation style to all around straa Set rotation style to don´t rotate strdr Say ___ for ___ secs saytm Say ___ say Think ___ for ___ secs thtim Think ___ think Show show Hide hide Change size by ___ chsiz Set size to ___ setsz Go to front front Go back ___ layers back Clear clear Stamp stamp Pen down pendw Pen up penup Change pen color by ___ colch Set pen color to ___ clset Change pen shade by ___ chsha Set pen shade to ___ stsha Change pen size by ___ chpsz Set pen size to ___ stps Wait ___ secs wait Wait until ___ wttil Stop all stopa Stop other scripts in sprite stopo Stop this script stopt Ask ___ and wait ask Reset timer rttim List of cycles (forever etc.) Forever forvr1 forvr2 Repeat ___ repet1 repet2 Repeat until ___ rptil1 rptil2 If ___ then if1 if2 If ___ then else ife1 ife2 ife3 List of inputs (position x, direction, etc): x position posx y position posy direction dir size size answer answr key ___ pressed press¤m___ mouse down? click mouse x mousx mouse y mousy timer timer days since 2000 mtwth List of combining operators (+-*/, mod, etc.): 1 operator: ¤sneg Not ___ ¤ssqrt Square root ¤sabs Absolute value ¤srndd Round down ¤srndu Round up ¤ssin Sin ¤scos Cos ¤stg Tg/Tan ¤sasin Arcussin ¤sacos Arcuscosin ¤satg Arcustangens ¤sln Ln ¤slog Log ¤sepowr e to the power of ¤stnpwr 10 to the power of 2 operators: ¤s+ + ¤s- - ¤s* * ¤s/ / ¤srand Random from ___ to ___ ¤sor or ¤sand and ¤sjoin join ¤smod mod