text: module.exports = function (Blockly) {// Do not edit this file; automatically generated by build.py.
      'use strict';
  
      /*
  
   Visual Blocks Language
  
   Copyright 2012 Google Inc.
   https://developers.google.com/blockly/
  
   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at
  
     http://www.apache.org/licenses/LICENSE-2.0
  
   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
  */
      Blockly.JavaScript = new Blockly.Generator("JavaScript");
      Blockly.JavaScript.addReservedWords("Blockly,break,case,catch,continue,debugger,default,delete,do,else,finally,for,function,if,in,instanceof,new,return,switch,this,throw,try,typeof,var,void,while,with,class,enum,export,extends,import,super,implements,interface,let,package,private,protected,public,static,yield,const,null,true,false,Array,ArrayBuffer,Boolean,Date,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Error,eval,EvalError,Float32Array,Float64Array,Function,Infinity,Int16Array,Int32Array,Int8Array,isFinite,isNaN,Iterator,JSON,Math,NaN,Number,Object,parseFloat,parseInt,RangeError,ReferenceError,RegExp,StopIteration,String,SyntaxError,TypeError,Uint16Array,Uint32Array,Uint8Array,Uint8ClampedArray,undefined,uneval,URIError,applicationCache,closed,Components,content,_content,controllers,crypto,defaultStatus,dialogArguments,directories,document,frameElement,frames,fullScreen,globalStorage,history,innerHeight,innerWidth,length,location,locationbar,localStorage,menubar,messageManager,mozAnimationStartTime,mozInnerScreenX,mozInnerScreenY,mozPaintCount,name,navigator,opener,outerHeight,outerWidth,pageXOffset,pageYOffset,parent,performance,personalbar,pkcs11,returnValue,screen,screenX,screenY,scrollbars,scrollMaxX,scrollMaxY,scrollX,scrollY,self,sessionStorage,sidebar,status,statusbar,toolbar,top,URL,window,addEventListener,alert,atob,back,blur,btoa,captureEvents,clearImmediate,clearInterval,clearTimeout,close,confirm,disableExternalCapture,dispatchEvent,dump,enableExternalCapture,escape,find,focus,forward,GeckoActiveXObject,getAttention,getAttentionWithCycleCount,getComputedStyle,getSelection,home,matchMedia,maximize,minimize,moveBy,moveTo,mozRequestAnimationFrame,open,openDialog,postMessage,print,prompt,QueryInterface,releaseEvents,removeEventListener,resizeBy,resizeTo,restore,routeEvent,scroll,scrollBy,scrollByLines,scrollByPages,scrollTo,setCursor,setImmediate,setInterval,setResizable,setTimeout,showModalDialog,sizeToContent,stop,unescape,updateCommands,XPCNativeWrapper,XPCSafeJSObjectWrapper,onabort,onbeforeunload,onblur,onchange,onclick,onclose,oncontextmenu,ondevicemotion,ondeviceorientation,ondragdrop,onerror,onfocus,onhashchange,onkeydown,onkeypress,onkeyup,onload,onmousedown,onmousemove,onmouseout,onmouseover,onmouseup,onmozbeforepaint,onpaint,onpopstate,onreset,onresize,onscroll,onselect,onsubmit,onunload,onpageshow,onpagehide,Image,Option,Worker,Event,Range,File,FileReader,Blob,BlobBuilder,Attr,CDATASection,CharacterData,Comment,console,DocumentFragment,DocumentType,DomConfiguration,DOMError,DOMErrorHandler,DOMException,DOMImplementation,DOMImplementationList,DOMImplementationRegistry,DOMImplementationSource,DOMLocator,DOMObject,DOMString,DOMStringList,DOMTimeStamp,DOMUserData,Entity,EntityReference,MediaQueryList,MediaQueryListListener,NameList,NamedNodeMap,Node,NodeFilter,NodeIterator,NodeList,Notation,Plugin,PluginArray,ProcessingInstruction,SharedWorker,Text,TimeRanges,Treewalker,TypeInfo,UserDataHandler,Worker,WorkerGlobalScope,HTMLDocument,HTMLElement,HTMLAnchorElement,HTMLAppletElement,HTMLAudioElement,HTMLAreaElement,HTMLBaseElement,HTMLBaseFontElement,HTMLBodyElement,HTMLBRElement,HTMLButtonElement,HTMLCanvasElement,HTMLDirectoryElement,HTMLDivElement,HTMLDListElement,HTMLEmbedElement,HTMLFieldSetElement,HTMLFontElement,HTMLFormElement,HTMLFrameElement,HTMLFrameSetElement,HTMLHeadElement,HTMLHeadingElement,HTMLHtmlElement,HTMLHRElement,HTMLIFrameElement,HTMLImageElement,HTMLInputElement,HTMLKeygenElement,HTMLLabelElement,HTMLLIElement,HTMLLinkElement,HTMLMapElement,HTMLMenuElement,HTMLMetaElement,HTMLModElement,HTMLObjectElement,HTMLOListElement,HTMLOptGroupElement,HTMLOptionElement,HTMLOutputElement,HTMLParagraphElement,HTMLParamElement,HTMLPreElement,HTMLQuoteElement,HTMLScriptElement,HTMLSelectElement,HTMLSourceElement,HTMLSpanElement,HTMLStyleElement,HTMLTableElement,HTMLTableCaptionElement,HTMLTableCellElement,HTMLTableDataCellElement,HTMLTableHeaderCellElement,HTMLTableColElement,HTMLTableRowElement,HTMLTableSectionElement,HTMLTextAreaElement,HTMLTimeElement,HTMLTitleElement,HTMLTrackElement,HTMLUListElement,HTMLUnknownElement,HTMLVideoElement,HTMLCanvasElement,CanvasRenderingContext2D,CanvasGradient,CanvasPattern,TextMetrics,ImageData,CanvasPixelArray,HTMLAudioElement,HTMLVideoElement,NotifyAudioAvailableEvent,HTMLCollection,HTMLAllCollection,HTMLFormControlsCollection,HTMLOptionsCollection,HTMLPropertiesCollection,DOMTokenList,DOMSettableTokenList,DOMStringMap,RadioNodeList,SVGDocument,SVGElement,SVGAElement,SVGAltGlyphElement,SVGAltGlyphDefElement,SVGAltGlyphItemElement,SVGAnimationElement,SVGAnimateElement,SVGAnimateColorElement,SVGAnimateMotionElement,SVGAnimateTransformElement,SVGSetElement,SVGCircleElement,SVGClipPathElement,SVGColorProfileElement,SVGCursorElement,SVGDefsElement,SVGDescElement,SVGEllipseElement,SVGFilterElement,SVGFilterPrimitiveStandardAttributes,SVGFEBlendElement,SVGFEColorMatrixElement,SVGFEComponentTransferElement,SVGFECompositeElement,SVGFEConvolveMatrixElement,SVGFEDiffuseLightingElement,SVGFEDisplacementMapElement,SVGFEDistantLightElement,SVGFEFloodElement,SVGFEGaussianBlurElement,SVGFEImageElement,SVGFEMergeElement,SVGFEMergeNodeElement,SVGFEMorphologyElement,SVGFEOffsetElement,SVGFEPointLightElement,SVGFESpecularLightingElement,SVGFESpotLightElement,SVGFETileElement,SVGFETurbulenceElement,SVGComponentTransferFunctionElement,SVGFEFuncRElement,SVGFEFuncGElement,SVGFEFuncBElement,SVGFEFuncAElement,SVGFontElement,SVGFontFaceElement,SVGFontFaceFormatElement,SVGFontFaceNameElement,SVGFontFaceSrcElement,SVGFontFaceUriElement,SVGForeignObjectElement,SVGGElement,SVGGlyphElement,SVGGlyphRefElement,SVGGradientElement,SVGLinearGradientElement,SVGRadialGradientElement,SVGHKernElement,SVGImageElement,SVGLineElement,SVGMarkerElement,SVGMaskElement,SVGMetadataElement,SVGMissingGlyphElement,SVGMPathElement,SVGPathElement,SVGPatternElement,SVGPolylineElement,SVGPolygonElement,SVGRectElement,SVGScriptElement,SVGStopElement,SVGStyleElement,SVGSVGElement,SVGSwitchElement,SVGSymbolElement,SVGTextElement,SVGTextPathElement,SVGTitleElement,SVGTRefElement,SVGTSpanElement,SVGUseElement,SVGViewElement,SVGVKernElement,SVGAngle,SVGColor,SVGICCColor,SVGElementInstance,SVGElementInstanceList,SVGLength,SVGLengthList,SVGMatrix,SVGNumber,SVGNumberList,SVGPaint,SVGPoint,SVGPointList,SVGPreserveAspectRatio,SVGRect,SVGStringList,SVGTransform,SVGTransformList,SVGAnimatedAngle,SVGAnimatedBoolean,SVGAnimatedEnumeration,SVGAnimatedInteger,SVGAnimatedLength,SVGAnimatedLengthList,SVGAnimatedNumber,SVGAnimatedNumberList,SVGAnimatedPreserveAspectRatio,SVGAnimatedRect,SVGAnimatedString,SVGAnimatedTransformList,SVGPathSegList,SVGPathSeg,SVGPathSegArcAbs,SVGPathSegArcRel,SVGPathSegClosePath,SVGPathSegCurvetoCubicAbs,SVGPathSegCurvetoCubicRel,SVGPathSegCurvetoCubicSmoothAbs,SVGPathSegCurvetoCubicSmoothRel,SVGPathSegCurvetoQuadraticAbs,SVGPathSegCurvetoQuadraticRel,SVGPathSegCurvetoQuadraticSmoothAbs,SVGPathSegCurvetoQuadraticSmoothRel,SVGPathSegLinetoAbs,SVGPathSegLinetoHorizontalAbs,SVGPathSegLinetoHorizontalRel,SVGPathSegLinetoRel,SVGPathSegLinetoVerticalAbs,SVGPathSegLinetoVerticalRel,SVGPathSegMovetoAbs,SVGPathSegMovetoRel,ElementTimeControl,TimeEvent,SVGAnimatedPathData,SVGAnimatedPoints,SVGColorProfileRule,SVGCSSRule,SVGExternalResourcesRequired,SVGFitToViewBox,SVGLangSpace,SVGLocatable,SVGRenderingIntent,SVGStylable,SVGTests,SVGTextContentElement,SVGTextPositioningElement,SVGTransformable,SVGUnitTypes,SVGURIReference,SVGViewSpec,SVGZoomAndPan");
      Blockly.JavaScript.ORDER_ATOMIC = 0;
      Blockly.JavaScript.ORDER_NEW = 1.1;
      Blockly.JavaScript.ORDER_MEMBER = 1.2;
      Blockly.JavaScript.ORDER_FUNCTION_CALL = 2;
      Blockly.JavaScript.ORDER_INCREMENT = 3;
      Blockly.JavaScript.ORDER_DECREMENT = 3;
      Blockly.JavaScript.ORDER_BITWISE_NOT = 4.1;
      Blockly.JavaScript.ORDER_UNARY_PLUS = 4.2;
      Blockly.JavaScript.ORDER_UNARY_NEGATION = 4.3;
      Blockly.JavaScript.ORDER_LOGICAL_NOT = 4.4;
      Blockly.JavaScript.ORDER_TYPEOF = 4.5;
      Blockly.JavaScript.ORDER_VOID = 4.6;
      Blockly.JavaScript.ORDER_DELETE = 4.7;
      Blockly.JavaScript.ORDER_DIVISION = 5.1;
      Blockly.JavaScript.ORDER_MULTIPLICATION = 5.2;
      Blockly.JavaScript.ORDER_MODULUS = 5.3;
      Blockly.JavaScript.ORDER_SUBTRACTION = 6.1;
      Blockly.JavaScript.ORDER_ADDITION = 6.2;
      Blockly.JavaScript.ORDER_BITWISE_SHIFT = 7;
      Blockly.JavaScript.ORDER_RELATIONAL = 8;
      Blockly.JavaScript.ORDER_IN = 8;
      Blockly.JavaScript.ORDER_INSTANCEOF = 8;
      Blockly.JavaScript.ORDER_EQUALITY = 9;
      Blockly.JavaScript.ORDER_BITWISE_AND = 10;
      Blockly.JavaScript.ORDER_BITWISE_XOR = 11;
      Blockly.JavaScript.ORDER_BITWISE_OR = 12;
      Blockly.JavaScript.ORDER_LOGICAL_AND = 13;
      Blockly.JavaScript.ORDER_LOGICAL_OR = 14;
      Blockly.JavaScript.ORDER_CONDITIONAL = 15;
      Blockly.JavaScript.ORDER_ASSIGNMENT = 16;
      Blockly.JavaScript.ORDER_COMMA = 17;
      Blockly.JavaScript.ORDER_NONE = 99;
      Blockly.JavaScript.ORDER_OVERRIDES = [[Blockly.JavaScript.ORDER_FUNCTION_CALL, Blockly.JavaScript.ORDER_MEMBER], [Blockly.JavaScript.ORDER_FUNCTION_CALL, Blockly.JavaScript.ORDER_FUNCTION_CALL], [Blockly.JavaScript.ORDER_MEMBER, Blockly.JavaScript.ORDER_MEMBER], [Blockly.JavaScript.ORDER_MEMBER, Blockly.JavaScript.ORDER_FUNCTION_CALL], [Blockly.JavaScript.ORDER_LOGICAL_NOT, Blockly.JavaScript.ORDER_LOGICAL_NOT], [Blockly.JavaScript.ORDER_MULTIPLICATION, Blockly.JavaScript.ORDER_MULTIPLICATION], [Blockly.JavaScript.ORDER_ADDITION,
          Blockly.JavaScript.ORDER_ADDITION], [Blockly.JavaScript.ORDER_LOGICAL_AND, Blockly.JavaScript.ORDER_LOGICAL_AND], [Blockly.JavaScript.ORDER_LOGICAL_OR, Blockly.JavaScript.ORDER_LOGICAL_OR]];
      Blockly.JavaScript.init = function (a) {
          Blockly.JavaScript.definitions_ = Object.create(null);
          Blockly.JavaScript.functionNames_ = Object.create(null);
          Blockly.JavaScript.variableDB_ ? Blockly.JavaScript.variableDB_.reset() : Blockly.JavaScript.variableDB_ = new Blockly.Names(Blockly.JavaScript.RESERVED_WORDS_);
          var b = [];
          a = a.getAllVariables();
          if (a.length) {
              for (var c = 0; c < a.length; c++) b[c] = Blockly.JavaScript.variableDB_.getName(a[c].name, Blockly.Variables.NAME_TYPE);
              Blockly.JavaScript.definitions_.variables = "var " + b.join(", ") +
                  ";"
          }
      };
      Blockly.JavaScript.finish = function (a) {
          var b = [], c;
          for (c in Blockly.JavaScript.definitions_) b.push(Blockly.JavaScript.definitions_[c]);
          delete Blockly.JavaScript.definitions_;
          delete Blockly.JavaScript.functionNames_;
          Blockly.JavaScript.variableDB_.reset();
          return b.join("\n\n") + "\n\n\n" + a
      };
      Blockly.JavaScript.scrubNakedValue = function (a) {
          return a + ";\n"
      };
      Blockly.JavaScript.quote_ = function (a) {
          a = a.replace(/\\/g, "\\\\").replace(/\n/g, "\\\n").replace(/'/g, "\\'");
          return "'" + a + "'"
      };
      Blockly.JavaScript.scrub_ = function (a, b) {
          var c = "";
          if (!a.outputConnection || !a.outputConnection.targetConnection) {
              var d = a.getCommentText();
              (d = Blockly.utils.wrap(d, Blockly.JavaScript.COMMENT_WRAP - 3)) && (c = a.getProcedureDef ? c + ("/**\n" + Blockly.JavaScript.prefixLines(d + "\n", " * ") + " */\n") : c + Blockly.JavaScript.prefixLines(d + "\n", "// "));
              for (var e = 0; e < a.inputList.length; e++) a.inputList[e].type == Blockly.INPUT_VALUE && (d = a.inputList[e].connection.targetBlock()) && (d = Blockly.JavaScript.allNestedComments(d)) && (c +=
                  Blockly.JavaScript.prefixLines(d, "// "))
          }
          e = a.nextConnection && a.nextConnection.targetBlock();
          e = Blockly.JavaScript.blockToCode(e);
          return c + b + e
      };
      Blockly.JavaScript.getAdjusted = function (a, b, c, d, e) {
          c = c || 0;
          e = e || Blockly.JavaScript.ORDER_NONE;
          a.workspace.options.oneBasedIndex && c--;
          var f = a.workspace.options.oneBasedIndex ? "1" : "0";
          a = 0 < c ? Blockly.JavaScript.valueToCode(a, b, Blockly.JavaScript.ORDER_ADDITION) || f : 0 > c ? Blockly.JavaScript.valueToCode(a, b, Blockly.JavaScript.ORDER_SUBTRACTION) || f : d ? Blockly.JavaScript.valueToCode(a, b, Blockly.JavaScript.ORDER_UNARY_NEGATION) || f : Blockly.JavaScript.valueToCode(a, b, e) || f;
          if (Blockly.isNumber(a)) a = parseFloat(a) + c,
          d && (a = -a); else {
              if (0 < c) {
                  a = a + " + " + c;
                  var g = Blockly.JavaScript.ORDER_ADDITION
              } else 0 > c && (a = a + " - " + -c, g = Blockly.JavaScript.ORDER_SUBTRACTION);
              d && (a = c ? "-(" + a + ")" : "-" + a, g = Blockly.JavaScript.ORDER_UNARY_NEGATION);
              g = Math.floor(g);
              e = Math.floor(e);
              g && e >= g && (a = "(" + a + ")")
          }
          return a
      };
      Blockly.JavaScript.colour = {};
      Blockly.JavaScript.colour_picker = function (a) {
          return ["'" + a.getFieldValue("COLOUR") + "'", Blockly.JavaScript.ORDER_ATOMIC]
      };
      Blockly.JavaScript.colour_random = function (a) {
          return [Blockly.JavaScript.provideFunction_("colourRandom", ["function " + Blockly.JavaScript.FUNCTION_NAME_PLACEHOLDER_ + "() {", "  var num = Math.floor(Math.random() * Math.pow(2, 24));", "  return '#' + ('00000' + num.toString(16)).substr(-6);", "}"]) + "()", Blockly.JavaScript.ORDER_FUNCTION_CALL]
      };
      Blockly.JavaScript.colour_rgb = function (a) {
          var b = Blockly.JavaScript.valueToCode(a, "RED", Blockly.JavaScript.ORDER_COMMA) || 0,
              c = Blockly.JavaScript.valueToCode(a, "GREEN", Blockly.JavaScript.ORDER_COMMA) || 0;
          a = Blockly.JavaScript.valueToCode(a, "BLUE", Blockly.JavaScript.ORDER_COMMA) || 0;
          return [Blockly.JavaScript.provideFunction_("colourRgb", ["function " + Blockly.JavaScript.FUNCTION_NAME_PLACEHOLDER_ + "(r, g, b) {", "  r = Math.max(Math.min(Number(r), 100), 0) * 2.55;", "  g = Math.max(Math.min(Number(g), 100), 0) * 2.55;",
              "  b = Math.max(Math.min(Number(b), 100), 0) * 2.55;", "  r = ('0' + (Math.round(r) || 0).toString(16)).slice(-2);", "  g = ('0' + (Math.round(g) || 0).toString(16)).slice(-2);", "  b = ('0' + (Math.round(b) || 0).toString(16)).slice(-2);", "  return '#' + r + g + b;", "}"]) + "(" + b + ", " + c + ", " + a + ")", Blockly.JavaScript.ORDER_FUNCTION_CALL]
      };
      Blockly.JavaScript.colour_blend = function (a) {
          var b = Blockly.JavaScript.valueToCode(a, "COLOUR1", Blockly.JavaScript.ORDER_COMMA) || "'#000000'",
              c = Blockly.JavaScript.valueToCode(a, "COLOUR2", Blockly.JavaScript.ORDER_COMMA) || "'#000000'";
          a = Blockly.JavaScript.valueToCode(a, "RATIO", Blockly.JavaScript.ORDER_COMMA) || .5;
          return [Blockly.JavaScript.provideFunction_("colourBlend", ["function " + Blockly.JavaScript.FUNCTION_NAME_PLACEHOLDER_ + "(c1, c2, ratio) {", "  ratio = Math.max(Math.min(Number(ratio), 1), 0);", "  var r1 = parseInt(c1.substring(1, 3), 16);",
              "  var g1 = parseInt(c1.substring(3, 5), 16);", "  var b1 = parseInt(c1.substring(5, 7), 16);", "  var r2 = parseInt(c2.substring(1, 3), 16);", "  var g2 = parseInt(c2.substring(3, 5), 16);", "  var b2 = parseInt(c2.substring(5, 7), 16);", "  var r = Math.round(r1 * (1 - ratio) + r2 * ratio);", "  var g = Math.round(g1 * (1 - ratio) + g2 * ratio);", "  var b = Math.round(b1 * (1 - ratio) + b2 * ratio);", "  r = ('0' + (r || 0).toString(16)).slice(-2);", "  g = ('0' + (g || 0).toString(16)).slice(-2);", "  b = ('0' + (b || 0).toString(16)).slice(-2);",
              "  return '#' + r + g + b;", "}"]) + "(" + b + ", " + c + ", " + a + ")", Blockly.JavaScript.ORDER_FUNCTION_CALL]
      };
      Blockly.JavaScript.lists = {};
      Blockly.JavaScript.lists_create_empty = function (a) {
          return ["[]", Blockly.JavaScript.ORDER_ATOMIC]
      };
      Blockly.JavaScript.lists_create_with = function (a) {
          for (var b = Array(a.itemCount_), c = 0; c < a.itemCount_; c++) b[c] = Blockly.JavaScript.valueToCode(a, "ADD" + c, Blockly.JavaScript.ORDER_COMMA) || "null";
          return ["[" + b.join(", ") + "]", Blockly.JavaScript.ORDER_ATOMIC]
      };
      Blockly.JavaScript.lists_repeat = function (a) {
          var b = Blockly.JavaScript.provideFunction_("listsRepeat", ["function " + Blockly.JavaScript.FUNCTION_NAME_PLACEHOLDER_ + "(value, n) {", "  var array = [];", "  for (var i = 0; i < n; i++) {", "    array[i] = value;", "  }", "  return array;", "}"]),
              c = Blockly.JavaScript.valueToCode(a, "ITEM", Blockly.JavaScript.ORDER_COMMA) || "null";
          a = Blockly.JavaScript.valueToCode(a, "NUM", Blockly.JavaScript.ORDER_COMMA) || "0";
          return [b + "(" + c + ", " + a + ")", Blockly.JavaScript.ORDER_FUNCTION_CALL]
      };
      Blockly.JavaScript.lists_length = function (a) {
          return [(Blockly.JavaScript.valueToCode(a, "VALUE", Blockly.JavaScript.ORDER_MEMBER) || "[]") + ".length", Blockly.JavaScript.ORDER_MEMBER]
      };
      Blockly.JavaScript.lists_isEmpty = function (a) {
          return ["!" + (Blockly.JavaScript.valueToCode(a, "VALUE", Blockly.JavaScript.ORDER_MEMBER) || "[]") + ".length", Blockly.JavaScript.ORDER_LOGICAL_NOT]
      };
      Blockly.JavaScript.lists_indexOf = function (a) {
          var b = "FIRST" == a.getFieldValue("END") ? "indexOf" : "lastIndexOf",
              c = Blockly.JavaScript.valueToCode(a, "FIND", Blockly.JavaScript.ORDER_NONE) || "''",
              b = (Blockly.JavaScript.valueToCode(a, "VALUE", Blockly.JavaScript.ORDER_MEMBER) || "[]") + "." + b + "(" + c + ")";
          return a.workspace.options.oneBasedIndex ? [b + " + 1", Blockly.JavaScript.ORDER_ADDITION] : [b, Blockly.JavaScript.ORDER_FUNCTION_CALL]
      };
      Blockly.JavaScript.lists_getIndex = function (a) {
          var b = a.getFieldValue("MODE") || "GET", c = a.getFieldValue("WHERE") || "FROM_START";
          var d = Blockly.JavaScript.valueToCode(a, "VALUE", "RANDOM" == c ? Blockly.JavaScript.ORDER_COMMA : Blockly.JavaScript.ORDER_MEMBER) || "[]";
          switch (c) {
              case "FIRST":
                  if ("GET" == b) return [d + "[0]", Blockly.JavaScript.ORDER_MEMBER];
                  if ("GET_REMOVE" == b) return [d + ".shift()", Blockly.JavaScript.ORDER_MEMBER];
                  if ("REMOVE" == b) return d + ".shift();\n";
                  break;
              case "LAST":
                  if ("GET" == b) return [d + ".slice(-1)[0]",
                      Blockly.JavaScript.ORDER_MEMBER];
                  if ("GET_REMOVE" == b) return [d + ".pop()", Blockly.JavaScript.ORDER_MEMBER];
                  if ("REMOVE" == b) return d + ".pop();\n";
                  break;
              case "FROM_START":
                  a = Blockly.JavaScript.getAdjusted(a, "AT");
                  if ("GET" == b) return [d + "[" + a + "]", Blockly.JavaScript.ORDER_MEMBER];
                  if ("GET_REMOVE" == b) return [d + ".splice(" + a + ", 1)[0]", Blockly.JavaScript.ORDER_FUNCTION_CALL];
                  if ("REMOVE" == b) return d + ".splice(" + a + ", 1);\n";
                  break;
              case "FROM_END":
                  a = Blockly.JavaScript.getAdjusted(a, "AT", 1, !0);
                  if ("GET" == b) return [d + ".slice(" +
                  a + ")[0]", Blockly.JavaScript.ORDER_FUNCTION_CALL];
                  if ("GET_REMOVE" == b) return [d + ".splice(" + a + ", 1)[0]", Blockly.JavaScript.ORDER_FUNCTION_CALL];
                  if ("REMOVE" == b) return d + ".splice(" + a + ", 1);";
                  break;
              case "RANDOM":
                  d = Blockly.JavaScript.provideFunction_("listsGetRandomItem", ["function " + Blockly.JavaScript.FUNCTION_NAME_PLACEHOLDER_ + "(list, remove) {", "  var x = Math.floor(Math.random() * list.length);", "  if (remove) {", "    return list.splice(x, 1)[0];", "  } else {", "    return list[x];", "  }", "}"]) + "(" + d +
                      ", " + ("GET" != b) + ")";
                  if ("GET" == b || "GET_REMOVE" == b) return [d, Blockly.JavaScript.ORDER_FUNCTION_CALL];
                  if ("REMOVE" == b) return d + ";\n"
          }
          throw"Unhandled combination (lists_getIndex).";
      };
      Blockly.JavaScript.lists_setIndex = function (a) {
          function b() {
              if (c.match(/^\w+$/)) return "";
              var a = Blockly.JavaScript.variableDB_.getDistinctName("tmpList", Blockly.Variables.NAME_TYPE),
                  b = "var " + a + " = " + c + ";\n";
              c = a;
              return b
          }
  
          var c = Blockly.JavaScript.valueToCode(a, "LIST", Blockly.JavaScript.ORDER_MEMBER) || "[]",
              d = a.getFieldValue("MODE") || "GET", e = a.getFieldValue("WHERE") || "FROM_START",
              f = Blockly.JavaScript.valueToCode(a, "TO", Blockly.JavaScript.ORDER_ASSIGNMENT) || "null";
          switch (e) {
              case "FIRST":
                  if ("SET" == d) return c +
                      "[0] = " + f + ";\n";
                  if ("INSERT" == d) return c + ".unshift(" + f + ");\n";
                  break;
              case "LAST":
                  if ("SET" == d) return a = b(), a + (c + "[" + c + ".length - 1] = " + f + ";\n");
                  if ("INSERT" == d) return c + ".push(" + f + ");\n";
                  break;
              case "FROM_START":
                  e = Blockly.JavaScript.getAdjusted(a, "AT");
                  if ("SET" == d) return c + "[" + e + "] = " + f + ";\n";
                  if ("INSERT" == d) return c + ".splice(" + e + ", 0, " + f + ");\n";
                  break;
              case "FROM_END":
                  e = Blockly.JavaScript.getAdjusted(a, "AT", 1, !1, Blockly.JavaScript.ORDER_SUBTRACTION);
                  a = b();
                  if ("SET" == d) return a + (c + "[" + c + ".length - " + e +
                      "] = " + f + ";\n");
                  if ("INSERT" == d) return a + (c + ".splice(" + c + ".length - " + e + ", 0, " + f + ");\n");
                  break;
              case "RANDOM":
                  a = b();
                  e = Blockly.JavaScript.variableDB_.getDistinctName("tmpX", Blockly.Variables.NAME_TYPE);
                  a += "var " + e + " = Math.floor(Math.random() * " + c + ".length);\n";
                  if ("SET" == d) return a + (c + "[" + e + "] = " + f + ";\n");
                  if ("INSERT" == d) return a + (c + ".splice(" + e + ", 0, " + f + ");\n")
          }
          throw"Unhandled combination (lists_setIndex).";
      };
      Blockly.JavaScript.lists.getIndex_ = function (a, b, c) {
          return "FIRST" == b ? "0" : "FROM_END" == b ? a + ".length - 1 - " + c : "LAST" == b ? a + ".length - 1" : c
      };
      Blockly.JavaScript.lists_getSublist = function (a) {
          var b = Blockly.JavaScript.valueToCode(a, "LIST", Blockly.JavaScript.ORDER_MEMBER) || "[]",
              c = a.getFieldValue("WHERE1"), d = a.getFieldValue("WHERE2");
          if ("FIRST" == c && "LAST" == d) var e = b + ".slice(0)"; else if (b.match(/^\w+$/) || "FROM_END" != c && "FROM_START" == d) {
              switch (c) {
                  case "FROM_START":
                      e = Blockly.JavaScript.getAdjusted(a, "AT1");
                      break;
                  case "FROM_END":
                      e = Blockly.JavaScript.getAdjusted(a, "AT1", 1, !1, Blockly.JavaScript.ORDER_SUBTRACTION);
                      e = b + ".length - " + e;
                      break;
                  case "FIRST":
                      e =
                          "0";
                      break;
                  default:
                      throw"Unhandled option (lists_getSublist).";
              }
              switch (d) {
                  case "FROM_START":
                      a = Blockly.JavaScript.getAdjusted(a, "AT2", 1);
                      break;
                  case "FROM_END":
                      a = Blockly.JavaScript.getAdjusted(a, "AT2", 0, !1, Blockly.JavaScript.ORDER_SUBTRACTION);
                      a = b + ".length - " + a;
                      break;
                  case "LAST":
                      a = b + ".length";
                      break;
                  default:
                      throw"Unhandled option (lists_getSublist).";
              }
              e = b + ".slice(" + e + ", " + a + ")"
          } else {
              e = Blockly.JavaScript.getAdjusted(a, "AT1");
              a = Blockly.JavaScript.getAdjusted(a, "AT2");
              var f = Blockly.JavaScript.lists.getIndex_,
                  g = {FIRST: "First", LAST: "Last", FROM_START: "FromStart", FROM_END: "FromEnd"};
              e = Blockly.JavaScript.provideFunction_("subsequence" + g[c] + g[d], ["function " + Blockly.JavaScript.FUNCTION_NAME_PLACEHOLDER_ + "(sequence" + ("FROM_END" == c || "FROM_START" == c ? ", at1" : "") + ("FROM_END" == d || "FROM_START" == d ? ", at2" : "") + ") {", "  var start = " + f("sequence", c, "at1") + ";", "  var end = " + f("sequence", d, "at2") + " + 1;", "  return sequence.slice(start, end);", "}"]) + "(" + b + ("FROM_END" == c || "FROM_START" == c ? ", " + e : "") + ("FROM_END" == d || "FROM_START" ==
              d ? ", " + a : "") + ")"
          }
          return [e, Blockly.JavaScript.ORDER_FUNCTION_CALL]
      };
      Blockly.JavaScript.lists_sort = function (a) {
          var b = Blockly.JavaScript.valueToCode(a, "LIST", Blockly.JavaScript.ORDER_FUNCTION_CALL) || "[]",
              c = "1" === a.getFieldValue("DIRECTION") ? 1 : -1;
          a = a.getFieldValue("TYPE");
          var d = Blockly.JavaScript.provideFunction_("listsGetSortCompare", ["function " + Blockly.JavaScript.FUNCTION_NAME_PLACEHOLDER_ + "(type, direction) {", "  var compareFuncs = {", '    "NUMERIC": function(a, b) {', "        return parseFloat(a) - parseFloat(b); },", '    "TEXT": function(a, b) {', "        return a.toString() > b.toString() ? 1 : -1; },",
              '    "IGNORE_CASE": function(a, b) {', "        return a.toString().toLowerCase() > b.toString().toLowerCase() ? 1 : -1; },", "  };", "  var compare = compareFuncs[type];", "  return function(a, b) { return compare(a, b) * direction; }", "}"]);
          return [b + ".slice().sort(" + d + '("' + a + '", ' + c + "))", Blockly.JavaScript.ORDER_FUNCTION_CALL]
      };
      Blockly.JavaScript.lists_split = function (a) {
          var b = Blockly.JavaScript.valueToCode(a, "INPUT", Blockly.JavaScript.ORDER_MEMBER),
              c = Blockly.JavaScript.valueToCode(a, "DELIM", Blockly.JavaScript.ORDER_NONE) || "''";
          a = a.getFieldValue("MODE");
          if ("SPLIT" == a) b || (b = "''"), a = "split"; else if ("JOIN" == a) b || (b = "[]"), a = "join"; else throw"Unknown mode: " + a;
          return [b + "." + a + "(" + c + ")", Blockly.JavaScript.ORDER_FUNCTION_CALL]
      };
      Blockly.JavaScript.lists_reverse = function (a) {
          return [(Blockly.JavaScript.valueToCode(a, "LIST", Blockly.JavaScript.ORDER_FUNCTION_CALL) || "[]") + ".slice().reverse()", Blockly.JavaScript.ORDER_FUNCTION_CALL]
      };
      Blockly.JavaScript.logic = {};
      Blockly.JavaScript.controls_if = function (a) {
          var b = 0, c = "";
          do {
              var d = Blockly.JavaScript.valueToCode(a, "IF" + b, Blockly.JavaScript.ORDER_NONE) || "false";
              var e = Blockly.JavaScript.statementToCode(a, "DO" + b);
              c += (0 < b ? " else " : "") + "if (" + d + ") {\n" + e + "}";
              ++b
          } while (a.getInput("IF" + b));
          a.getInput("ELSE") && (e = Blockly.JavaScript.statementToCode(a, "ELSE"), c += " else {\n" + e + "}");
          return c + "\n"
      };
      Blockly.JavaScript.controls_ifelse = Blockly.JavaScript.controls_if;
      Blockly.JavaScript.logic_compare = function (a) {
          var b = {EQ: "==", NEQ: "!=", LT: "<", LTE: "<=", GT: ">", GTE: ">="}[a.getFieldValue("OP")],
              c = "==" == b || "!=" == b ? Blockly.JavaScript.ORDER_EQUALITY : Blockly.JavaScript.ORDER_RELATIONAL,
              d = Blockly.JavaScript.valueToCode(a, "A", c) || "0";
          a = Blockly.JavaScript.valueToCode(a, "B", c) || "0";
          return [d + " " + b + " " + a, c]
      };
      Blockly.JavaScript.logic_operation = function (a) {
          var b = "AND" == a.getFieldValue("OP") ? "&&" : "||",
              c = "&&" == b ? Blockly.JavaScript.ORDER_LOGICAL_AND : Blockly.JavaScript.ORDER_LOGICAL_OR,
              d = Blockly.JavaScript.valueToCode(a, "A", c);
          a = Blockly.JavaScript.valueToCode(a, "B", c);
          if (d || a) {
              var e = "&&" == b ? "true" : "false";
              d || (d = e);
              a || (a = e)
          } else a = d = "false";
          return [d + " " + b + " " + a, c]
      };
      Blockly.JavaScript.logic_negate = function (a) {
          var b = Blockly.JavaScript.ORDER_LOGICAL_NOT;
          return ["!" + (Blockly.JavaScript.valueToCode(a, "BOOL", b) || "true"), b]
      };
      Blockly.JavaScript.logic_boolean = function (a) {
          return ["TRUE" == a.getFieldValue("BOOL") ? "true" : "false", Blockly.JavaScript.ORDER_ATOMIC]
      };
      Blockly.JavaScript.logic_null = function (a) {
          return ["null", Blockly.JavaScript.ORDER_ATOMIC]
      };
      Blockly.JavaScript.logic_ternary = function (a) {
          var b = Blockly.JavaScript.valueToCode(a, "IF", Blockly.JavaScript.ORDER_CONDITIONAL) || "false",
              c = Blockly.JavaScript.valueToCode(a, "THEN", Blockly.JavaScript.ORDER_CONDITIONAL) || "null";
          a = Blockly.JavaScript.valueToCode(a, "ELSE", Blockly.JavaScript.ORDER_CONDITIONAL) || "null";
          return [b + " ? " + c + " : " + a, Blockly.JavaScript.ORDER_CONDITIONAL]
      };
      Blockly.JavaScript.loops = {};
      Blockly.JavaScript.controls_repeat_ext = function (a) {
          var b = a.getField("TIMES") ? String(Number(a.getFieldValue("TIMES"))) : Blockly.JavaScript.valueToCode(a, "TIMES", Blockly.JavaScript.ORDER_ASSIGNMENT) || "0";
          var c = Blockly.JavaScript.statementToCode(a, "DO"), c = Blockly.JavaScript.addLoopTrap(c, a.id), d = "",
              e = Blockly.JavaScript.variableDB_.getDistinctName("count", Blockly.Variables.NAME_TYPE);
          a = b;
          b.match(/^\w+$/) || Blockly.isNumber(b) || (a = Blockly.JavaScript.variableDB_.getDistinctName("repeat_end", Blockly.Variables.NAME_TYPE),
              d += "var " + a + " = " + b + ";\n");
          return d + ("for (var " + e + " = 0; " + e + " < " + a + "; " + e + "++) {\n" + c + "}\n")
      };
      Blockly.JavaScript.controls_repeat = Blockly.JavaScript.controls_repeat_ext;
      Blockly.JavaScript.controls_whileUntil = function (a) {
          var b = "UNTIL" == a.getFieldValue("MODE"),
              c = Blockly.JavaScript.valueToCode(a, "BOOL", b ? Blockly.JavaScript.ORDER_LOGICAL_NOT : Blockly.JavaScript.ORDER_NONE) || "false",
              d = Blockly.JavaScript.statementToCode(a, "DO"), d = Blockly.JavaScript.addLoopTrap(d, a.id);
          b && (c = "!" + c);
          return "while (" + c + ") {\n" + d + "}\n"
      };
      Blockly.JavaScript.controls_for = function (a) {
          var b = Blockly.JavaScript.variableDB_.getName(a.getFieldValue("VAR"), Blockly.Variables.NAME_TYPE);
          var c = Blockly.JavaScript.valueToCode(a, "FROM", Blockly.JavaScript.ORDER_ASSIGNMENT) || "0";
          var d = Blockly.JavaScript.valueToCode(a, "TO", Blockly.JavaScript.ORDER_ASSIGNMENT) || "0",
              e = Blockly.JavaScript.valueToCode(a, "BY", Blockly.JavaScript.ORDER_ASSIGNMENT) || "1",
              f = Blockly.JavaScript.statementToCode(a, "DO"), f = Blockly.JavaScript.addLoopTrap(f, a.id);
          if (Blockly.isNumber(c) &&
              Blockly.isNumber(d) && Blockly.isNumber(e)) {
              var g = parseFloat(c) <= parseFloat(d);
              a = "for (" + b + " = " + c + "; " + b + (g ? " <= " : " >= ") + d + "; " + b;
              b = Math.abs(parseFloat(e));
              a = (1 == b ? a + (g ? "++" : "--") : a + ((g ? " += " : " -= ") + b)) + (") {\n" + f + "}\n")
          } else a = "", g = c, c.match(/^\w+$/) || Blockly.isNumber(c) || (g = Blockly.JavaScript.variableDB_.getDistinctName(b + "_start", Blockly.Variables.NAME_TYPE), a += "var " + g + " = " + c + ";\n"), c = d, d.match(/^\w+$/) || Blockly.isNumber(d) || (c = Blockly.JavaScript.variableDB_.getDistinctName(b + "_end", Blockly.Variables.NAME_TYPE),
              a += "var " + c + " = " + d + ";\n"), d = Blockly.JavaScript.variableDB_.getDistinctName(b + "_inc", Blockly.Variables.NAME_TYPE), a += "var " + d + " = ", a = Blockly.isNumber(e) ? a + (Math.abs(e) + ";\n") : a + ("Math.abs(" + e + ");\n"), a = a + ("if (" + g + " > " + c + ") {\n") + (Blockly.JavaScript.INDENT + d + " = -" + d + ";\n"), a += "}\n", a += "for (" + b + " = " + g + "; " + d + " >= 0 ? " + b + " <= " + c + " : " + b + " >= " + c + "; " + b + " += " + d + ") {\n" + f + "}\n";
          return a
      };
      Blockly.JavaScript.controls_forEach = function (a) {
          var b = Blockly.JavaScript.variableDB_.getName(a.getFieldValue("VAR"), Blockly.Variables.NAME_TYPE),
              c = Blockly.JavaScript.valueToCode(a, "LIST", Blockly.JavaScript.ORDER_ASSIGNMENT) || "[]",
              d = Blockly.JavaScript.statementToCode(a, "DO"), d = Blockly.JavaScript.addLoopTrap(d, a.id);
          a = "";
          var e = c;
          c.match(/^\w+$/) || (e = Blockly.JavaScript.variableDB_.getDistinctName(b + "_list", Blockly.Variables.NAME_TYPE), a += "var " + e + " = " + c + ";\n");
          c = Blockly.JavaScript.variableDB_.getDistinctName(b +
              "_index", Blockly.Variables.NAME_TYPE);
          d = Blockly.JavaScript.INDENT + b + " = " + e + "[" + c + "];\n" + d;
          return a + ("for (var " + c + " in " + e + ") {\n" + d + "}\n")
      };
      Blockly.JavaScript.controls_flow_statements = function (a) {
          switch (a.getFieldValue("FLOW")) {
              case "BREAK":
                  return "break;\n";
              case "CONTINUE":
                  return "continue;\n"
          }
          throw"Unknown flow statement.";
      };
      Blockly.JavaScript.math = {};
      Blockly.JavaScript.math_number = function (a) {
          return [parseFloat(a.getFieldValue("NUM")), Blockly.JavaScript.ORDER_ATOMIC]
      };
      Blockly.JavaScript.math_arithmetic = function (a) {
          var b = {
              ADD: [" + ", Blockly.JavaScript.ORDER_ADDITION],
              MINUS: [" - ", Blockly.JavaScript.ORDER_SUBTRACTION],
              MULTIPLY: [" * ", Blockly.JavaScript.ORDER_MULTIPLICATION],
              DIVIDE: [" / ", Blockly.JavaScript.ORDER_DIVISION],
              POWER: [null, Blockly.JavaScript.ORDER_COMMA]
          }[a.getFieldValue("OP")], c = b[0], b = b[1], d = Blockly.JavaScript.valueToCode(a, "A", b) || "0";
          a = Blockly.JavaScript.valueToCode(a, "B", b) || "0";
          return c ? [d + c + a, b] : ["Math.pow(" + d + ", " + a + ")", Blockly.JavaScript.ORDER_FUNCTION_CALL]
      };
      Blockly.JavaScript.math_single = function (a) {
          var b = a.getFieldValue("OP");
          if ("NEG" == b) return a = Blockly.JavaScript.valueToCode(a, "NUM", Blockly.JavaScript.ORDER_UNARY_NEGATION) || "0", "-" == a[0] && (a = " " + a), ["-" + a, Blockly.JavaScript.ORDER_UNARY_NEGATION];
          a = "SIN" == b || "COS" == b || "TAN" == b ? Blockly.JavaScript.valueToCode(a, "NUM", Blockly.JavaScript.ORDER_DIVISION) || "0" : Blockly.JavaScript.valueToCode(a, "NUM", Blockly.JavaScript.ORDER_NONE) || "0";
          switch (b) {
              case "ABS":
                  var c = "Math.abs(" + a + ")";
                  break;
              case "ROOT":
                  c = "Math.sqrt(" +
                      a + ")";
                  break;
              case "LN":
                  c = "Math.log(" + a + ")";
                  break;
              case "EXP":
                  c = "Math.exp(" + a + ")";
                  break;
              case "POW10":
                  c = "Math.pow(10," + a + ")";
                  break;
              case "ROUND":
                  c = "Math.round(" + a + ")";
                  break;
              case "ROUNDUP":
                  c = "Math.ceil(" + a + ")";
                  break;
              case "ROUNDDOWN":
                  c = "Math.floor(" + a + ")";
                  break;
              case "SIN":
                  c = "Math.sin(" + a + " / 180 * Math.PI)";
                  break;
              case "COS":
                  c = "Math.cos(" + a + " / 180 * Math.PI)";
                  break;
              case "TAN":
                  c = "Math.tan(" + a + " / 180 * Math.PI)"
          }
          if (c) return [c, Blockly.JavaScript.ORDER_FUNCTION_CALL];
          switch (b) {
              case "LOG10":
                  c = "Math.log(" + a +
                      ") / Math.log(10)";
                  break;
              case "ASIN":
                  c = "Math.asin(" + a + ") / Math.PI * 180";
                  break;
              case "ACOS":
                  c = "Math.acos(" + a + ") / Math.PI * 180";
                  break;
              case "ATAN":
                  c = "Math.atan(" + a + ") / Math.PI * 180";
                  break;
              default:
                  throw"Unknown math operator: " + b;
          }
          return [c, Blockly.JavaScript.ORDER_DIVISION]
      };
      Blockly.JavaScript.math_constant = function (a) {
          return {
              PI: ["Math.PI", Blockly.JavaScript.ORDER_MEMBER],
              E: ["Math.E", Blockly.JavaScript.ORDER_MEMBER],
              GOLDEN_RATIO: ["(1 + Math.sqrt(5)) / 2", Blockly.JavaScript.ORDER_DIVISION],
              SQRT2: ["Math.SQRT2", Blockly.JavaScript.ORDER_MEMBER],
              SQRT1_2: ["Math.SQRT1_2", Blockly.JavaScript.ORDER_MEMBER],
              INFINITY: ["Infinity", Blockly.JavaScript.ORDER_ATOMIC]
          }[a.getFieldValue("CONSTANT")]
      };
      Blockly.JavaScript.math_number_property = function (a) {
          var b = Blockly.JavaScript.valueToCode(a, "NUMBER_TO_CHECK", Blockly.JavaScript.ORDER_MODULUS) || "0",
              c = a.getFieldValue("PROPERTY");
          if ("PRIME" == c) return [Blockly.JavaScript.provideFunction_("mathIsPrime", ["function " + Blockly.JavaScript.FUNCTION_NAME_PLACEHOLDER_ + "(n) {", "  // https://en.wikipedia.org/wiki/Primality_test#Naive_methods", "  if (n == 2 || n == 3) {", "    return true;", "  }", "  // False if n is NaN, negative, is 1, or not whole.", "  // And false if n is divisible by 2 or 3.",
              "  if (isNaN(n) || n <= 1 || n % 1 != 0 || n % 2 == 0 || n % 3 == 0) {", "    return false;", "  }", "  // Check all the numbers of form 6k +/- 1, up to sqrt(n).", "  for (var x = 6; x <= Math.sqrt(n) + 1; x += 6) {", "    if (n % (x - 1) == 0 || n % (x + 1) == 0) {", "      return false;", "    }", "  }", "  return true;", "}"]) + "(" + b + ")", Blockly.JavaScript.ORDER_FUNCTION_CALL];
          switch (c) {
              case "EVEN":
                  var d = b + " % 2 == 0";
                  break;
              case "ODD":
                  d = b + " % 2 == 1";
                  break;
              case "WHOLE":
                  d = b + " % 1 == 0";
                  break;
              case "POSITIVE":
                  d =
                      b + " > 0";
                  break;
              case "NEGATIVE":
                  d = b + " < 0";
                  break;
              case "DIVISIBLE_BY":
                  a = Blockly.JavaScript.valueToCode(a, "DIVISOR", Blockly.JavaScript.ORDER_MODULUS) || "0", d = b + " % " + a + " == 0"
          }
          return [d, Blockly.JavaScript.ORDER_EQUALITY]
      };
      Blockly.JavaScript.math_change = function (a) {
          var b = Blockly.JavaScript.valueToCode(a, "DELTA", Blockly.JavaScript.ORDER_ADDITION) || "0";
          a = Blockly.JavaScript.variableDB_.getName(a.getFieldValue("VAR"), Blockly.Variables.NAME_TYPE);
          return a + " = (typeof " + a + " == 'number' ? " + a + " : 0) + " + b + ";\n"
      };
      Blockly.JavaScript.math_round = Blockly.JavaScript.math_single;
      Blockly.JavaScript.math_trig = Blockly.JavaScript.math_single;
      Blockly.JavaScript.math_on_list = function (a) {
          var b = a.getFieldValue("OP");
          switch (b) {
              case "SUM":
                  a = Blockly.JavaScript.valueToCode(a, "LIST", Blockly.JavaScript.ORDER_MEMBER) || "[]";
                  a += ".reduce(function(x, y) {return x + y;})";
                  break;
              case "MIN":
                  a = Blockly.JavaScript.valueToCode(a, "LIST", Blockly.JavaScript.ORDER_COMMA) || "[]";
                  a = "Math.min.apply(null, " + a + ")";
                  break;
              case "MAX":
                  a = Blockly.JavaScript.valueToCode(a, "LIST", Blockly.JavaScript.ORDER_COMMA) || "[]";
                  a = "Math.max.apply(null, " + a + ")";
                  break;
              case "AVERAGE":
                  b = Blockly.JavaScript.provideFunction_("mathMean",
                      ["function " + Blockly.JavaScript.FUNCTION_NAME_PLACEHOLDER_ + "(myList) {", "  return myList.reduce(function(x, y) {return x + y;}) / myList.length;", "}"]);
                  a = Blockly.JavaScript.valueToCode(a, "LIST", Blockly.JavaScript.ORDER_NONE) || "[]";
                  a = b + "(" + a + ")";
                  break;
              case "MEDIAN":
                  b = Blockly.JavaScript.provideFunction_("mathMedian", ["function " + Blockly.JavaScript.FUNCTION_NAME_PLACEHOLDER_ + "(myList) {", "  var localList = myList.filter(function (x) {return typeof x == 'number';});", "  if (!localList.length) return null;",
                      "  localList.sort(function(a, b) {return b - a;});", "  if (localList.length % 2 == 0) {", "    return (localList[localList.length / 2 - 1] + localList[localList.length / 2]) / 2;", "  } else {", "    return localList[(localList.length - 1) / 2];", "  }", "}"]);
                  a = Blockly.JavaScript.valueToCode(a, "LIST", Blockly.JavaScript.ORDER_NONE) || "[]";
                  a = b + "(" + a + ")";
                  break;
              case "MODE":
                  b = Blockly.JavaScript.provideFunction_("mathModes", ["function " + Blockly.JavaScript.FUNCTION_NAME_PLACEHOLDER_ + "(values) {", "  var modes = [];",
                      "  var counts = [];", "  var maxCount = 0;", "  for (var i = 0; i < values.length; i++) {", "    var value = values[i];", "    var found = false;", "    var thisCount;", "    for (var j = 0; j < counts.length; j++) {", "      if (counts[j][0] === value) {", "        thisCount = ++counts[j][1];", "        found = true;", "        break;", "      }", "    }", "    if (!found) {", "      counts.push([value, 1]);", "      thisCount = 1;", "    }", "    maxCount = Math.max(thisCount, maxCount);", "  }", "  for (var j = 0; j < counts.length; j++) {",
                      "    if (counts[j][1] == maxCount) {", "        modes.push(counts[j][0]);", "    }", "  }", "  return modes;", "}"]);
                  a = Blockly.JavaScript.valueToCode(a, "LIST", Blockly.JavaScript.ORDER_NONE) || "[]";
                  a = b + "(" + a + ")";
                  break;
              case "STD_DEV":
                  b = Blockly.JavaScript.provideFunction_("mathStandardDeviation", ["function " + Blockly.JavaScript.FUNCTION_NAME_PLACEHOLDER_ + "(numbers) {", "  var n = numbers.length;", "  if (!n) return null;", "  var mean = numbers.reduce(function(x, y) {return x + y;}) / n;", "  var variance = 0;",
                      "  for (var j = 0; j < n; j++) {", "    variance += Math.pow(numbers[j] - mean, 2);", "  }", "  variance = variance / n;", "  return Math.sqrt(variance);", "}"]);
                  a = Blockly.JavaScript.valueToCode(a, "LIST", Blockly.JavaScript.ORDER_NONE) || "[]";
                  a = b + "(" + a + ")";
                  break;
              case "RANDOM":
                  b = Blockly.JavaScript.provideFunction_("mathRandomList", ["function " + Blockly.JavaScript.FUNCTION_NAME_PLACEHOLDER_ + "(list) {", "  var x = Math.floor(Math.random() * list.length);", "  return list[x];", "}"]);
                  a = Blockly.JavaScript.valueToCode(a,
                      "LIST", Blockly.JavaScript.ORDER_NONE) || "[]";
                  a = b + "(" + a + ")";
                  break;
              default:
                  throw"Unknown operator: " + b;
          }
          return [a, Blockly.JavaScript.ORDER_FUNCTION_CALL]
      };
      Blockly.JavaScript.math_modulo = function (a) {
          var b = Blockly.JavaScript.valueToCode(a, "DIVIDEND", Blockly.JavaScript.ORDER_MODULUS) || "0";
          a = Blockly.JavaScript.valueToCode(a, "DIVISOR", Blockly.JavaScript.ORDER_MODULUS) || "0";
          return [b + " % " + a, Blockly.JavaScript.ORDER_MODULUS]
      };
      Blockly.JavaScript.math_constrain = function (a) {
          var b = Blockly.JavaScript.valueToCode(a, "VALUE", Blockly.JavaScript.ORDER_COMMA) || "0",
              c = Blockly.JavaScript.valueToCode(a, "LOW", Blockly.JavaScript.ORDER_COMMA) || "0";
          a = Blockly.JavaScript.valueToCode(a, "HIGH", Blockly.JavaScript.ORDER_COMMA) || "Infinity";
          return ["Math.min(Math.max(" + b + ", " + c + "), " + a + ")", Blockly.JavaScript.ORDER_FUNCTION_CALL]
      };
      Blockly.JavaScript.math_random_int = function (a) {
          var b = Blockly.JavaScript.valueToCode(a, "FROM", Blockly.JavaScript.ORDER_COMMA) || "0";
          a = Blockly.JavaScript.valueToCode(a, "TO", Blockly.JavaScript.ORDER_COMMA) || "0";
          return [Blockly.JavaScript.provideFunction_("mathRandomInt", ["function " + Blockly.JavaScript.FUNCTION_NAME_PLACEHOLDER_ + "(a, b) {", "  if (a > b) {", "    // Swap a and b to ensure a is smaller.", "    var c = a;", "    a = b;", "    b = c;", "  }", "  return Math.floor(Math.random() * (b - a + 1) + a);",
              "}"]) + "(" + b + ", " + a + ")", Blockly.JavaScript.ORDER_FUNCTION_CALL]
      };
      Blockly.JavaScript.math_random_float = function (a) {
          return ["Math.random()", Blockly.JavaScript.ORDER_FUNCTION_CALL]
      };
      Blockly.JavaScript.procedures = {};
      Blockly.JavaScript.procedures_defreturn = function (a) {
          var b = Blockly.JavaScript.variableDB_.getName(a.getFieldValue("NAME"), Blockly.Procedures.NAME_TYPE),
              c = Blockly.JavaScript.statementToCode(a, "STACK");
          Blockly.JavaScript.STATEMENT_PREFIX && (c = Blockly.JavaScript.prefixLines(Blockly.JavaScript.STATEMENT_PREFIX.replace(/%1/g, "'" + a.id + "'"), Blockly.JavaScript.INDENT) + c);
          Blockly.JavaScript.INFINITE_LOOP_TRAP && (c = Blockly.JavaScript.INFINITE_LOOP_TRAP.replace(/%1/g, "'" + a.id + "'") + c);
          var d = Blockly.JavaScript.valueToCode(a,
              "RETURN", Blockly.JavaScript.ORDER_NONE) || "";
          d && (d = "  return " + d + ";\n");
          for (var e = [], f = 0; f < a.arguments_.length; f++) e[f] = Blockly.JavaScript.variableDB_.getName(a.arguments_[f], Blockly.Variables.NAME_TYPE);
          c = "function " + b + "(" + e.join(", ") + ") {\n" + c + d + "}";
          c = Blockly.JavaScript.scrub_(a, c);
          Blockly.JavaScript.definitions_["%" + b] = c;
          return null
      };
      Blockly.JavaScript.procedures_defnoreturn = Blockly.JavaScript.procedures_defreturn;
      Blockly.JavaScript.procedures_callreturn = function (a) {
          for (var b = Blockly.JavaScript.variableDB_.getName(a.getFieldValue("NAME"), Blockly.Procedures.NAME_TYPE), c = [], d = 0; d < a.arguments_.length; d++) c[d] = Blockly.JavaScript.valueToCode(a, "ARG" + d, Blockly.JavaScript.ORDER_COMMA) || "null";
          return [b + "(" + c.join(", ") + ")", Blockly.JavaScript.ORDER_FUNCTION_CALL]
      };
      Blockly.JavaScript.procedures_callnoreturn = function (a) {
          for (var b = Blockly.JavaScript.variableDB_.getName(a.getFieldValue("NAME"), Blockly.Procedures.NAME_TYPE), c = [], d = 0; d < a.arguments_.length; d++) c[d] = Blockly.JavaScript.valueToCode(a, "ARG" + d, Blockly.JavaScript.ORDER_COMMA) || "null";
          return b + "(" + c.join(", ") + ");\n"
      };
      Blockly.JavaScript.procedures_ifreturn = function (a) {
          var b = "if (" + (Blockly.JavaScript.valueToCode(a, "CONDITION", Blockly.JavaScript.ORDER_NONE) || "false") + ") {\n";
          a.hasReturnValue_ ? (a = Blockly.JavaScript.valueToCode(a, "VALUE", Blockly.JavaScript.ORDER_NONE) || "null", b += "  return " + a + ";\n") : b += "  return;\n";
          return b + "}\n"
      };
      Blockly.JavaScript.texts = {};
      Blockly.JavaScript.text = function (a) {
          return [Blockly.JavaScript.quote_(a.getFieldValue("TEXT")), Blockly.JavaScript.ORDER_ATOMIC]
      };
      Blockly.JavaScript.text_join = function (a) {
          switch (a.itemCount_) {
              case 0:
                  return ["''", Blockly.JavaScript.ORDER_ATOMIC];
              case 1:
                  return ["String(" + (Blockly.JavaScript.valueToCode(a, "ADD0", Blockly.JavaScript.ORDER_NONE) || "''") + ")", Blockly.JavaScript.ORDER_FUNCTION_CALL];
              case 2:
                  var b = Blockly.JavaScript.valueToCode(a, "ADD0", Blockly.JavaScript.ORDER_NONE) || "''";
                  a = Blockly.JavaScript.valueToCode(a, "ADD1", Blockly.JavaScript.ORDER_NONE) || "''";
                  return ["String(" + b + ") + String(" + a + ")", Blockly.JavaScript.ORDER_ADDITION];
              default:
                  for (var b = Array(a.itemCount_), c = 0; c < a.itemCount_; c++) b[c] = Blockly.JavaScript.valueToCode(a, "ADD" + c, Blockly.JavaScript.ORDER_COMMA) || "''";
                  a = "[" + b.join(",") + "].join('')";
                  return [a, Blockly.JavaScript.ORDER_FUNCTION_CALL]
          }
      };
      Blockly.JavaScript.text_append = function (a) {
          var b = Blockly.JavaScript.variableDB_.getName(a.getFieldValue("VAR"), Blockly.Variables.NAME_TYPE);
          a = Blockly.JavaScript.valueToCode(a, "TEXT", Blockly.JavaScript.ORDER_NONE) || "''";
          return b + " = String(" + b + ") + String(" + a + ");\n"
      };
      Blockly.JavaScript.text_length = function (a) {
          return [(Blockly.JavaScript.valueToCode(a, "VALUE", Blockly.JavaScript.ORDER_FUNCTION_CALL) || "''") + ".length", Blockly.JavaScript.ORDER_MEMBER]
      };
      Blockly.JavaScript.text_isEmpty = function (a) {
          return ["!" + (Blockly.JavaScript.valueToCode(a, "VALUE", Blockly.JavaScript.ORDER_MEMBER) || "''") + ".length", Blockly.JavaScript.ORDER_LOGICAL_NOT]
      };
      Blockly.JavaScript.text_indexOf = function (a) {
          var b = "FIRST" == a.getFieldValue("END") ? "indexOf" : "lastIndexOf",
              c = Blockly.JavaScript.valueToCode(a, "FIND", Blockly.JavaScript.ORDER_NONE) || "''",
              b = (Blockly.JavaScript.valueToCode(a, "VALUE", Blockly.JavaScript.ORDER_MEMBER) || "''") + "." + b + "(" + c + ")";
          return a.workspace.options.oneBasedIndex ? [b + " + 1", Blockly.JavaScript.ORDER_ADDITION] : [b, Blockly.JavaScript.ORDER_FUNCTION_CALL]
      };
      Blockly.JavaScript.text_charAt = function (a) {
          var b = a.getFieldValue("WHERE") || "FROM_START",
              c = Blockly.JavaScript.valueToCode(a, "VALUE", "RANDOM" == b ? Blockly.JavaScript.ORDER_NONE : Blockly.JavaScript.ORDER_MEMBER) || "''";
          switch (b) {
              case "FIRST":
                  return [c + ".charAt(0)", Blockly.JavaScript.ORDER_FUNCTION_CALL];
              case "LAST":
                  return [c + ".slice(-1)", Blockly.JavaScript.ORDER_FUNCTION_CALL];
              case "FROM_START":
                  return a = Blockly.JavaScript.getAdjusted(a, "AT"), [c + ".charAt(" + a + ")", Blockly.JavaScript.ORDER_FUNCTION_CALL];
              case "FROM_END":
                  return a =
                      Blockly.JavaScript.getAdjusted(a, "AT", 1, !0), [c + ".slice(" + a + ").charAt(0)", Blockly.JavaScript.ORDER_FUNCTION_CALL];
              case "RANDOM":
                  return [Blockly.JavaScript.provideFunction_("textRandomLetter", ["function " + Blockly.JavaScript.FUNCTION_NAME_PLACEHOLDER_ + "(text) {", "  var x = Math.floor(Math.random() * text.length);", "  return text[x];", "}"]) + "(" + c + ")", Blockly.JavaScript.ORDER_FUNCTION_CALL]
          }
          throw"Unhandled option (text_charAt).";
      };
      Blockly.JavaScript.text.getIndex_ = function (a, b, c) {
          return "FIRST" == b ? "0" : "FROM_END" == b ? a + ".length - 1 - " + c : "LAST" == b ? a + ".length - 1" : c
      };
      Blockly.JavaScript.text_getSubstring = function (a) {
          var b = Blockly.JavaScript.valueToCode(a, "STRING", Blockly.JavaScript.ORDER_FUNCTION_CALL) || "''",
              c = a.getFieldValue("WHERE1"), d = a.getFieldValue("WHERE2");
          if ("FIRST" == c && "LAST" == d) var e = b; else if (b.match(/^'?\w+'?$/) || "FROM_END" != c && "LAST" != c && "FROM_END" != d && "LAST" != d) {
              switch (c) {
                  case "FROM_START":
                      e = Blockly.JavaScript.getAdjusted(a, "AT1");
                      break;
                  case "FROM_END":
                      e = Blockly.JavaScript.getAdjusted(a, "AT1", 1, !1, Blockly.JavaScript.ORDER_SUBTRACTION);
                      e = b + ".length - " +
                          e;
                      break;
                  case "FIRST":
                      e = "0";
                      break;
                  default:
                      throw"Unhandled option (text_getSubstring).";
              }
              switch (d) {
                  case "FROM_START":
                      a = Blockly.JavaScript.getAdjusted(a, "AT2", 1);
                      break;
                  case "FROM_END":
                      a = Blockly.JavaScript.getAdjusted(a, "AT2", 0, !1, Blockly.JavaScript.ORDER_SUBTRACTION);
                      a = b + ".length - " + a;
                      break;
                  case "LAST":
                      a = b + ".length";
                      break;
                  default:
                      throw"Unhandled option (text_getSubstring).";
              }
              e = b + ".slice(" + e + ", " + a + ")"
          } else {
              e = Blockly.JavaScript.getAdjusted(a, "AT1");
              a = Blockly.JavaScript.getAdjusted(a, "AT2");
              var f = Blockly.JavaScript.text.getIndex_,
                  g = {FIRST: "First", LAST: "Last", FROM_START: "FromStart", FROM_END: "FromEnd"};
              e = Blockly.JavaScript.provideFunction_("subsequence" + g[c] + g[d], ["function " + Blockly.JavaScript.FUNCTION_NAME_PLACEHOLDER_ + "(sequence" + ("FROM_END" == c || "FROM_START" == c ? ", at1" : "") + ("FROM_END" == d || "FROM_START" == d ? ", at2" : "") + ") {", "  var start = " + f("sequence", c, "at1") + ";", "  var end = " + f("sequence", d, "at2") + " + 1;", "  return sequence.slice(start, end);", "}"]) + "(" + b + ("FROM_END" == c || "FROM_START" == c ? ", " + e : "") + ("FROM_END" == d || "FROM_START" ==
              d ? ", " + a : "") + ")"
          }
          return [e, Blockly.JavaScript.ORDER_FUNCTION_CALL]
      };
      Blockly.JavaScript.text_changeCase = function (a) {
          var b = {UPPERCASE: ".toUpperCase()", LOWERCASE: ".toLowerCase()", TITLECASE: null}[a.getFieldValue("CASE")];
          a = Blockly.JavaScript.valueToCode(a, "TEXT", b ? Blockly.JavaScript.ORDER_MEMBER : Blockly.JavaScript.ORDER_NONE) || "''";
          return [b ? a + b : Blockly.JavaScript.provideFunction_("textToTitleCase", ["function " + Blockly.JavaScript.FUNCTION_NAME_PLACEHOLDER_ + "(str) {", "  return str.replace(/\\S+/g,", "      function(txt) {return txt[0].toUpperCase() + txt.substring(1).toLowerCase();});", "}"]) +
              "(" + a + ")", Blockly.JavaScript.ORDER_FUNCTION_CALL]
      };
      Blockly.JavaScript.text_trim = function (a) {
          var b = {
              LEFT: ".replace(/^[\\s\\xa0]+/, '')",
              RIGHT: ".replace(/[\\s\\xa0]+$/, '')",
              BOTH: ".trim()"
          }[a.getFieldValue("MODE")];
          return [(Blockly.JavaScript.valueToCode(a, "TEXT", Blockly.JavaScript.ORDER_MEMBER) || "''") + b, Blockly.JavaScript.ORDER_FUNCTION_CALL]
      };
      Blockly.JavaScript.text_print = function (a) {
          return "window.alert(" + (Blockly.JavaScript.valueToCode(a, "TEXT", Blockly.JavaScript.ORDER_NONE) || "''") + ");\n"
      };
      Blockly.JavaScript.text_prompt_ext = function (a) {
          var b = "window.prompt(" + (a.getField("TEXT") ? Blockly.JavaScript.quote_(a.getFieldValue("TEXT")) : Blockly.JavaScript.valueToCode(a, "TEXT", Blockly.JavaScript.ORDER_NONE) || "''") + ")";
          "NUMBER" == a.getFieldValue("TYPE") && (b = "parseFloat(" + b + ")");
          return [b, Blockly.JavaScript.ORDER_FUNCTION_CALL]
      };
      Blockly.JavaScript.text_prompt = Blockly.JavaScript.text_prompt_ext;
      Blockly.JavaScript.text_count = function (a) {
          var b = Blockly.JavaScript.valueToCode(a, "TEXT", Blockly.JavaScript.ORDER_MEMBER) || "''";
          a = Blockly.JavaScript.valueToCode(a, "SUB", Blockly.JavaScript.ORDER_NONE) || "''";
          return [Blockly.JavaScript.provideFunction_("textCount", ["function " + Blockly.JavaScript.FUNCTION_NAME_PLACEHOLDER_ + "(haystack, needle) {", "  if (needle.length === 0) {", "    return haystack.length + 1;", "  } else {", "    return haystack.split(needle).length - 1;", "  }", "}"]) + "(" + b + ", " + a + ")", Blockly.JavaScript.ORDER_SUBTRACTION]
      };
      Blockly.JavaScript.text_replace = function (a) {
          var b = Blockly.JavaScript.valueToCode(a, "TEXT", Blockly.JavaScript.ORDER_MEMBER) || "''",
              c = Blockly.JavaScript.valueToCode(a, "FROM", Blockly.JavaScript.ORDER_NONE) || "''";
          a = Blockly.JavaScript.valueToCode(a, "TO", Blockly.JavaScript.ORDER_NONE) || "''";
          return [Blockly.JavaScript.provideFunction_("textReplace", ["function " + Blockly.JavaScript.FUNCTION_NAME_PLACEHOLDER_ + "(haystack, needle, replacement) {", '  needle = needle.replace(/([-()\\[\\]{}+?*.$\\^|,:#<!\\\\])/g,"\\\\$1")',
              '                 .replace(/\\x08/g,"\\\\x08");', "  return haystack.replace(new RegExp(needle, 'g'), replacement);", "}"]) + "(" + b + ", " + c + ", " + a + ")", Blockly.JavaScript.ORDER_MEMBER]
      };
      Blockly.JavaScript.text_reverse = function (a) {
          return [(Blockly.JavaScript.valueToCode(a, "TEXT", Blockly.JavaScript.ORDER_MEMBER) || "''") + ".split('').reverse().join('')", Blockly.JavaScript.ORDER_MEMBER]
      };
      Blockly.JavaScript.variables = {};
      Blockly.JavaScript.variables_get = function (a) {
          return [Blockly.JavaScript.variableDB_.getName(a.getFieldValue("VAR"), Blockly.Variables.NAME_TYPE), Blockly.JavaScript.ORDER_ATOMIC]
      };
      Blockly.JavaScript.variables_set = function (a) {
          var b = Blockly.JavaScript.valueToCode(a, "VALUE", Blockly.JavaScript.ORDER_ASSIGNMENT) || "0";
          return Blockly.JavaScript.variableDB_.getName(a.getFieldValue("VAR"), Blockly.Variables.NAME_TYPE) + " = " + b + ";\n"
      };
  
  
      // yak
  
  
      Blockly.JavaScript["yak_structure_setup"] = function (block) {
          var value_set = Blockly.JavaScript.statementToCode(block, "DO", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "function setup(){\n" + value_set + "};\n";
          return code
      };
      Blockly.JavaScript["yak_structure_draw"] = function (block) {
          var value_draw = Blockly.JavaScript.statementToCode(block, "DO", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "function draw(){\n" + value_draw + "};\n";
          return code
      };
      Blockly.JavaScript["yak_color_background_color"] = function (block) {
          var value_background = Blockly.JavaScript.valueToCode(block, "v_background", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "background(" + value_background + ");\n";
          return code
      };
      Blockly.JavaScript["yak_shape_ellipse"] = function (block) {
          var value_position_x = Blockly.JavaScript.valueToCode(block, "position_x", Blockly.JavaScript.ORDER_ATOMIC);
          var value_position_y = Blockly.JavaScript.valueToCode(block, "position_y", Blockly.JavaScript.ORDER_ATOMIC);
          var value_width = Blockly.JavaScript.valueToCode(block, "width", Blockly.JavaScript.ORDER_ATOMIC);
          var value_height = Blockly.JavaScript.valueToCode(block, "height", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "ellipse(" + value_position_x + "," + value_position_y + "," + value_width + ", " + value_height + ");\n";
          return code
      };
      Blockly.JavaScript["yak_rendering_createCanvas"] = function (block) {
          var value_width = Blockly.JavaScript.valueToCode(block, "v_width", Blockly.JavaScript.ORDER_ATOMIC);
          var value_height = Blockly.JavaScript.valueToCode(block, "v_height", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "createCanvas(" + value_width + ", " + value_height + ");\n";
          return code
      };
  
      //////////////////////////////////////////////////////////
      Blockly.JavaScript["yak_color_background_gray"] = function (block) {
          var value_background = Blockly.JavaScript.valueToCode(block, "v_background", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "background(" + "'" + value_background + "'" + ");\n";
          return code
      };
      Blockly.JavaScript["yak_color_background_color"] = function (block) {
          var value_background = Blockly.JavaScript.valueToCode(block, "v_background", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "background(" + value_background + ");\n";
          return code
      };
      Blockly.JavaScript["yak_color_background"] = function (block) {
          var value_v_x = Blockly.JavaScript.valueToCode(block, "v_x", Blockly.JavaScript.ORDER_ATOMIC);
          var value_v_y = Blockly.JavaScript.valueToCode(block, "v_y", Blockly.JavaScript.ORDER_ATOMIC);
          var value_v_z = Blockly.JavaScript.valueToCode(block, "v_z", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "background(" + value_v_x + "," + value_v_y + "," + value_v_z + ");\n";
          return code
      };
      Blockly.JavaScript["yak_color_clear"] = function (block) {
          var code = "clear(" + ");\n";
          return code
      };
  
      Blockly.JavaScript["yak_color_colorMode"] = function (block) {
          var dropdown_name = block.getFieldValue("NAME");
          var code = "colorMode(" + dropdown_name + ");\n";
          return code
      };
      Blockly.JavaScript["yak_color_fill"] = function (block) {
          var value_fill = Blockly.JavaScript.valueToCode(block, "v_fill", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "fill(" + value_fill + ");\n";
          return code
      };
      Blockly.JavaScript["yak_color_fillRGB"] = function (block) {
          var value_x = Blockly.JavaScript.valueToCode(block, "v_x", Blockly.JavaScript.ORDER_ATOMIC);
          var value_y = Blockly.JavaScript.valueToCode(block, "v_y", Blockly.JavaScript.ORDER_ATOMIC);
          var value_z = Blockly.JavaScript.valueToCode(block, "v_z", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "fill(" + value_x + "," + value_y + "," + value_z + ");\n";
          return code
      };
      Blockly.JavaScript["yak_color_fill4"] = function (block) {
          var value_x = Blockly.JavaScript.valueToCode(block, "v_x", Blockly.JavaScript.ORDER_ATOMIC);
          var value_y = Blockly.JavaScript.valueToCode(block, "v_y", Blockly.JavaScript.ORDER_ATOMIC);
          var value_z = Blockly.JavaScript.valueToCode(block, "v_z", Blockly.JavaScript.ORDER_ATOMIC);
          var value_a = Blockly.JavaScript.valueToCode(block, "v_a", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "fill(" + value_x + "," + value_y + "," + value_z + "," + value_a + ");\n";
          return code
      };
      Blockly.JavaScript["yak_color_noFill"] = function (block) {
          var code = "noFill(" + ");\n";
          return code
      };
      Blockly.JavaScript["yak_color_noStroke"] = function (block) {
          var code = "noStroke(" + ");\n";
          return code
      };
      Blockly.JavaScript["yak_color_stroke"] = function (block) {
          var value_stroke = Blockly.JavaScript.valueToCode(block, "v_stroke", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "stroke(" + value_stroke + ");\n";
          return code
      };
      Blockly.JavaScript["yak_shape_beginContour"] = function (block) {
          var code = "beginContour(" + ");\n";
          return code
      };
      Blockly.JavaScript["yak_shape_beginShape"] = function (block) {
          var dropdown_name = block.getFieldValue("NAME");
          var code = "beginShape(" + dropdown_name + ");\n";
          return code
      };
      Blockly.JavaScript["yak_shape_bezierVertex"] = function (block) {
          var value_position_x = Blockly.JavaScript.valueToCode(block, "position_x", Blockly.JavaScript.ORDER_ATOMIC);
          var value_position_y = Blockly.JavaScript.valueToCode(block, "position_y", Blockly.JavaScript.ORDER_ATOMIC);
          var value_width = Blockly.JavaScript.valueToCode(block, "width", Blockly.JavaScript.ORDER_ATOMIC);
          var value_height = Blockly.JavaScript.valueToCode(block, "height", Blockly.JavaScript.ORDER_ATOMIC);
          var value_v_z = Blockly.JavaScript.valueToCode(block, "v_z", Blockly.JavaScript.ORDER_ATOMIC);
          var value_v_w = Blockly.JavaScript.valueToCode(block, "v_w", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "bezierVertex(" + value_position_x + "," + value_position_y + "," + value_width + ", " + value_height + "," + value_v_z + "," + value_v_w + ");\n";
          return code
      };
      Blockly.JavaScript["yak_shape_endShape"] = function (block) {
          var dropdown_name = block.getFieldValue("NAME");
          var code = "endShape(" + dropdown_name + ");\n";
          return code
      };
      Blockly.JavaScript["yak_shape_curveVertex"] = function (block) {
          var value_v_x = Blockly.JavaScript.valueToCode(block, "v_x", Blockly.JavaScript.ORDER_ATOMIC);
          var value_v_y = Blockly.JavaScript.valueToCode(block, "v_y", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "curveVertex(" + value_v_x + "," + value_v_y + ");\n";
          return code
      };
      Blockly.JavaScript["yak_shape_endContour"] = function (block) {
          var code = "endContour(" + ");\n";
          return code
      };
      Blockly.JavaScript["yak_shape_quadraticVertex"] = function (block) {
          var value_position_x = Blockly.JavaScript.valueToCode(block, "position_x", Blockly.JavaScript.ORDER_ATOMIC);
          var value_position_y = Blockly.JavaScript.valueToCode(block, "position_y", Blockly.JavaScript.ORDER_ATOMIC);
          var value_width = Blockly.JavaScript.valueToCode(block, "width", Blockly.JavaScript.ORDER_ATOMIC);
          var value_height = Blockly.JavaScript.valueToCode(block, "height", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "quadraticVertex(" + value_position_x + "," + value_position_y + "," + value_width + ", " + value_height + ");\n";
          return code
      };
      Blockly.JavaScript["yak_shape_vertex"] = function (block) {
          var value_width = Blockly.JavaScript.valueToCode(block, "v_width", Blockly.JavaScript.ORDER_ATOMIC);
          var value_height = Blockly.JavaScript.valueToCode(block, "v_height", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "vertex(" + value_width + ", " + value_height + ");\n";
          return code
      };
      Blockly.JavaScript["yak_shape_bezier4"] = function (block) {
          var value_position_x = Blockly.JavaScript.valueToCode(block, "position_x", Blockly.JavaScript.ORDER_ATOMIC);
          var value_position_y = Blockly.JavaScript.valueToCode(block, "position_y", Blockly.JavaScript.ORDER_ATOMIC);
          var value_width = Blockly.JavaScript.valueToCode(block, "width", Blockly.JavaScript.ORDER_ATOMIC);
          var value_height = Blockly.JavaScript.valueToCode(block, "height", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "bezier(" + value_position_x + "," + value_position_y + "," + value_width + ", " + value_height + ");\n";
          return code
      };
      Blockly.JavaScript["yak_shape_bezier8"] = function (block) {
          var value_position_x = Blockly.JavaScript.valueToCode(block, "position_x", Blockly.JavaScript.ORDER_ATOMIC);
          var value_position_y = Blockly.JavaScript.valueToCode(block, "position_y", Blockly.JavaScript.ORDER_ATOMIC);
          var value_width = Blockly.JavaScript.valueToCode(block, "width", Blockly.JavaScript.ORDER_ATOMIC);
          var value_height = Blockly.JavaScript.valueToCode(block, "height", Blockly.JavaScript.ORDER_ATOMIC);
          var value_v_x = Blockly.JavaScript.valueToCode(block, "v_x", Blockly.JavaScript.ORDER_ATOMIC);
          var value_v_y = Blockly.JavaScript.valueToCode(block, "v_y", Blockly.JavaScript.ORDER_ATOMIC);
          var value_v_z = Blockly.JavaScript.valueToCode(block, "v_z", Blockly.JavaScript.ORDER_ATOMIC);
          var value_v_w = Blockly.JavaScript.valueToCode(block, "v_w", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "bezier(" + value_position_x + "," + value_position_y + "," + value_width + ", " + value_height + "," + value_v_x + "," + value_v_y + "," + value_v_z + "," + value_v_w + ");\n";
          return code
      };
      Blockly.JavaScript["yak_shape_bezier4"] = function (block) {
          var value_position_x = Blockly.JavaScript.valueToCode(block, "position_x", Blockly.JavaScript.ORDER_ATOMIC);
          var value_position_y = Blockly.JavaScript.valueToCode(block, "position_y", Blockly.JavaScript.ORDER_ATOMIC);
          var value_width = Blockly.JavaScript.valueToCode(block, "width", Blockly.JavaScript.ORDER_ATOMIC);
          var value_height = Blockly.JavaScript.valueToCode(block, "height", Blockly.JavaScript.ORDER_ATOMIC);
          var value_v_z = Blockly.JavaScript.valueToCode(block, "v_z", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "bezier(" + value_position_x + "," + value_position_y + "," + value_width + ", " + value_height + "," + value_v_z + ");\n";
          return code
      };
      Blockly.JavaScript["yak_shape_bezierPoint"] = function (block) {
          var value_position_x = Blockly.JavaScript.valueToCode(block, "position_x", Blockly.JavaScript.ORDER_ATOMIC);
          var value_position_y = Blockly.JavaScript.valueToCode(block, "position_y", Blockly.JavaScript.ORDER_ATOMIC);
          var value_width = Blockly.JavaScript.valueToCode(block, "width", Blockly.JavaScript.ORDER_ATOMIC);
          var value_height = Blockly.JavaScript.valueToCode(block, "height", Blockly.JavaScript.ORDER_ATOMIC);
          var value_v_z = Blockly.JavaScript.valueToCode(block, "v_z", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "bezierPoint(" + value_position_x + "," + value_position_y + "," + value_width + ", " + value_height + "," + value_v_z + ");\n";
          return code
      };
      Blockly.JavaScript["yak_shape_bezierTangent"] = function (block) {
          var value_position_x = Blockly.JavaScript.valueToCode(block, "position_x", Blockly.JavaScript.ORDER_ATOMIC);
          var value_position_y = Blockly.JavaScript.valueToCode(block, "position_y", Blockly.JavaScript.ORDER_ATOMIC);
          var value_width = Blockly.JavaScript.valueToCode(block, "width", Blockly.JavaScript.ORDER_ATOMIC);
          var value_height = Blockly.JavaScript.valueToCode(block, "height", Blockly.JavaScript.ORDER_ATOMIC);
          var value_v_z = Blockly.JavaScript.valueToCode(block, "v_z", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "bezierTangent(" + value_position_x + "," + value_position_y + "," + value_width + ", " + value_height + "," + value_v_z + ");\n";
          return code
      };
      Blockly.JavaScript["yak_shape_curve4"] = function (block) {
          var value_position_x = Blockly.JavaScript.valueToCode(block, "position_x", Blockly.JavaScript.ORDER_ATOMIC);
          var value_position_y = Blockly.JavaScript.valueToCode(block, "position_y", Blockly.JavaScript.ORDER_ATOMIC);
          var value_width = Blockly.JavaScript.valueToCode(block, "width", Blockly.JavaScript.ORDER_ATOMIC);
          var value_height = Blockly.JavaScript.valueToCode(block, "height", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "curve(" + value_position_x + "," + value_position_y + "," + value_width + ", " + value_height + ");\n";
          return code
      };
      Blockly.JavaScript["yak_shape_curve8"] = function (block) {
          var value_position_x = Blockly.JavaScript.valueToCode(block, "position_x", Blockly.JavaScript.ORDER_ATOMIC);
          var value_position_y = Blockly.JavaScript.valueToCode(block, "position_y", Blockly.JavaScript.ORDER_ATOMIC);
          var value_width = Blockly.JavaScript.valueToCode(block, "width", Blockly.JavaScript.ORDER_ATOMIC);
          var value_height = Blockly.JavaScript.valueToCode(block, "height", Blockly.JavaScript.ORDER_ATOMIC);
          var value_v_x = Blockly.JavaScript.valueToCode(block, "v_x", Blockly.JavaScript.ORDER_ATOMIC);
          var value_v_y = Blockly.JavaScript.valueToCode(block, "v_y", Blockly.JavaScript.ORDER_ATOMIC);
          var value_v_z = Blockly.JavaScript.valueToCode(block, "v_z", Blockly.JavaScript.ORDER_ATOMIC);
          var value_v_w = Blockly.JavaScript.valueToCode(block, "v_w", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "curve(" + value_position_x + "," + value_position_y + "," + value_width + ", " + value_height + "," + value_v_x + "," + value_v_y + "," + value_v_z + "," + value_v_w + ");\n";
          return code
      };
      Blockly.JavaScript["yak_shape_curveTightness"] = function (block) {
          var value_curveTightness = Blockly.JavaScript.valueToCode(block, "v_curveTightness", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "curveTightness(" + value_curveTightness + ");\n";
          return code
      };
      Blockly.JavaScript["yak_shape_curvePoint"] = function (block) {
          var value_position_x = Blockly.JavaScript.valueToCode(block, "position_x", Blockly.JavaScript.ORDER_ATOMIC);
          var value_position_y = Blockly.JavaScript.valueToCode(block, "position_y", Blockly.JavaScript.ORDER_ATOMIC);
          var value_width = Blockly.JavaScript.valueToCode(block, "width", Blockly.JavaScript.ORDER_ATOMIC);
          var value_height = Blockly.JavaScript.valueToCode(block, "height", Blockly.JavaScript.ORDER_ATOMIC);
          var value_v_z = Blockly.JavaScript.valueToCode(block, "v_z", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "curvePoint(" + value_position_x + "," + value_position_y + "," + value_width + ", " + value_height + "," + value_v_z + ");\n";
          return code
      };
      Blockly.JavaScript["yak_shape_curveTangent"] = function (block) {
          var value_position_x = Blockly.JavaScript.valueToCode(block, "position_x", Blockly.JavaScript.ORDER_ATOMIC);
          var value_position_y = Blockly.JavaScript.valueToCode(block, "position_y", Blockly.JavaScript.ORDER_ATOMIC);
          var value_width = Blockly.JavaScript.valueToCode(block, "width", Blockly.JavaScript.ORDER_ATOMIC);
          var value_height = Blockly.JavaScript.valueToCode(block, "height", Blockly.JavaScript.ORDER_ATOMIC);
          var value_v_z = Blockly.JavaScript.valueToCode(block, "v_z", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "curveTangent(" + value_position_x + "," + value_position_y + "," + value_width + ", " + value_height + "," + value_v_z + ");\n";
          return code
      };
      Blockly.JavaScript["yak_shape_ellipseMode"] = function (block) {
          var dropdown_name = block.getFieldValue("NAME");
          var code = "ellipseMode(" + dropdown_name + ");\n";
          return code
      };
      Blockly.JavaScript["yak_shape_noSmooth"] = function (block) {
          var code = "noSmooth(" + ");\n";
          return code
      };
      Blockly.JavaScript["yak_shape_rectMode"] = function (block) {
          var dropdown_name = block.getFieldValue("NAME");
          var code = "rectMode(" + dropdown_name + ");\n";
          return code
      };
      Blockly.JavaScript["yak_shape_smooth"] = function (block) {
          var code = "smooth(" + ");\n";
          return code
      };
      Blockly.JavaScript["yak_shape_strokeJoin"] = function (block) {
          var dropdown_name = block.getFieldValue("NAME");
          var code = "strokeJoin(" + dropdown_name + ");\n";
          return code
      };
      Blockly.JavaScript["yak_shape_strokeWeight"] = function (block) {
          var value_strokeWeight = Blockly.JavaScript.valueToCode(block, "v_strokeWeight", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "strokeWeight(" + value_strokeWeight + ");\n";
          return code
      };
      Blockly.JavaScript["yak_color_strokeWeight"] = function (block) {
          var value_strokeWeight = Blockly.JavaScript.valueToCode(block, "v_strokeWeight", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "strokeWeight(" + value_strokeWeight + ");\n";
          return code
      };
      Blockly.JavaScript["yak_shape_loadModel"] = function (block) {
          var value_loadModel = Blockly.JavaScript.valueToCode(block, "v_loadModel", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "loadModel(" + "'" + value_loadModel + "'" + ");\n";
          return code
      };
      Blockly.JavaScript["yak_shape_model"] = function (block) {
          var value_model = Blockly.JavaScript.valueToCode(block, "v_model", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "model(" + value_model + ");\n";
          return code
      };
      Blockly.JavaScript["yak_shape_plane"] = function (block) {
          var value_width = Blockly.JavaScript.valueToCode(block, "v_width", Blockly.JavaScript.ORDER_ATOMIC);
          var value_height = Blockly.JavaScript.valueToCode(block, "v_height", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "plane(" + value_width + ", " + value_height + ");\n";
          return code
      };
      Blockly.JavaScript["yak_shape_box"] = function (block) {
          var value_width = Blockly.JavaScript.valueToCode(block, "v_width", Blockly.JavaScript.ORDER_ATOMIC);
          var value_height = Blockly.JavaScript.valueToCode(block, "v_height", Blockly.JavaScript.ORDER_ATOMIC);
          var value_depth = Blockly.JavaScript.valueToCode(block, "v_depth", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "box(" + value_width + ", " + value_height + "," + value_depth + ");\n";
          return code
      };
      Blockly.JavaScript["yak_shape_sphere"] = function (block) {
          var value_sphere = Blockly.JavaScript.valueToCode(block, "v_sphere", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "sphere(" + value_sphere + ");\n";
          return code
      };
      Blockly.JavaScript["yak_shape_cylinder"] = function (block) {
          var value_width = Blockly.JavaScript.valueToCode(block, "v_width", Blockly.JavaScript.ORDER_ATOMIC);
          var value_height = Blockly.JavaScript.valueToCode(block, "v_height", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "cylinder(" + value_width + ", " + value_height + ");\n";
          return code
      };
      Blockly.JavaScript["yak_shape_cone"] = function (block) {
          var value_width = Blockly.JavaScript.valueToCode(block, "v_width", Blockly.JavaScript.ORDER_ATOMIC);
          var value_height = Blockly.JavaScript.valueToCode(block, "v_height", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "cone(" + value_width + ", " + value_height + ");\n";
          return code
      };
      Blockly.JavaScript["yak_shape_ellipsoid"] = function (block) {
          var value_width = Blockly.JavaScript.valueToCode(block, "v_width", Blockly.JavaScript.ORDER_ATOMIC);
          var value_height = Blockly.JavaScript.valueToCode(block, "v_height", Blockly.JavaScript.ORDER_ATOMIC);
          var value_depth = Blockly.JavaScript.valueToCode(block, "v_depth", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "ellipsoid(" + value_width + ", " + value_height + "," + value_depth + ");\n";
          return code
      };
      Blockly.JavaScript["yak_shape_torus"] = function (block) {
          var value_width = Blockly.JavaScript.valueToCode(block, "v_width", Blockly.JavaScript.ORDER_ATOMIC);
          var value_height = Blockly.JavaScript.valueToCode(block, "v_height", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "torus(" + value_width + ", " + value_height + ");\n";
          return code
      };
      Blockly.JavaScript["yak_shape_arc"] = function (block) {
          var value_position_x = Blockly.JavaScript.valueToCode(block, "position_x", Blockly.JavaScript.ORDER_ATOMIC);
          var value_position_y = Blockly.JavaScript.valueToCode(block, "position_y", Blockly.JavaScript.ORDER_ATOMIC);
          var value_width = Blockly.JavaScript.valueToCode(block, "width", Blockly.JavaScript.ORDER_ATOMIC);
          var value_height = Blockly.JavaScript.valueToCode(block, "height", Blockly.JavaScript.ORDER_ATOMIC);
          var value_v_x = Blockly.JavaScript.valueToCode(block, "v_x", Blockly.JavaScript.ORDER_ATOMIC);
          var value_v_y = Blockly.JavaScript.valueToCode(block, "v_y", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "arc(" + value_position_x + "," + value_position_y + "," + value_width + ", " + value_height + "," + value_v_x + "," + value_v_y + ");\n";
          return code
      };
      Blockly.JavaScript["yak_shape_arc_mode"] = function (block) {
          var value_position_x = Blockly.JavaScript.valueToCode(block, "position_x", Blockly.JavaScript.ORDER_ATOMIC);
          var value_position_y = Blockly.JavaScript.valueToCode(block, "position_y", Blockly.JavaScript.ORDER_ATOMIC);
          var value_width = Blockly.JavaScript.valueToCode(block, "width", Blockly.JavaScript.ORDER_ATOMIC);
          var value_height = Blockly.JavaScript.valueToCode(block, "height", Blockly.JavaScript.ORDER_ATOMIC);
          var value_v_x = Blockly.JavaScript.valueToCode(block, "v_x", Blockly.JavaScript.ORDER_ATOMIC);
          var value_v_y = Blockly.JavaScript.valueToCode(block, "v_y", Blockly.JavaScript.ORDER_ATOMIC);
          var dropdown_name = block.getFieldValue("NAME");
          var code = "arc(" + value_position_x + "," + value_position_y + "," + value_width + ", " + value_height + "," + value_v_x + "," + value_v_y + "," + dropdown_name + ");\n";
          return code
      };
      Blockly.JavaScript["yak_shape_ellipse"] = function (block) {
          var value_position_x = Blockly.JavaScript.valueToCode(block, "position_x", Blockly.JavaScript.ORDER_ATOMIC);
          var value_position_y = Blockly.JavaScript.valueToCode(block, "position_y", Blockly.JavaScript.ORDER_ATOMIC);
          var value_width = Blockly.JavaScript.valueToCode(block, "width", Blockly.JavaScript.ORDER_ATOMIC);
          var value_height = Blockly.JavaScript.valueToCode(block, "height", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "ellipse(" + value_position_x + "," + value_position_y + "," + value_width + ", " + value_height + ");\n";
          return code
      };
      Blockly.JavaScript["yak_shape_line"] = function (block) {
          var value_position_x = Blockly.JavaScript.valueToCode(block, "position_x", Blockly.JavaScript.ORDER_ATOMIC);
          var value_position_y = Blockly.JavaScript.valueToCode(block, "position_y", Blockly.JavaScript.ORDER_ATOMIC);
          var value_width = Blockly.JavaScript.valueToCode(block, "width", Blockly.JavaScript.ORDER_ATOMIC);
          var value_height = Blockly.JavaScript.valueToCode(block, "height", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "line(" + value_position_x + "," + value_position_y + "," + value_width + ", " + value_height + ");\n";
          return code
      };
      Blockly.JavaScript["yak_shape_point"] = function (block) {
          var value_v_x = Blockly.JavaScript.valueToCode(block, "v_x", Blockly.JavaScript.ORDER_ATOMIC);
          var value_v_y = Blockly.JavaScript.valueToCode(block, "v_y", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "point(" + value_v_x + "," + value_v_y + ");\n";
          return code
      };
      Blockly.JavaScript["yak_shape_quad"] = function (block) {
          var value_position_x = Blockly.JavaScript.valueToCode(block, "position_x", Blockly.JavaScript.ORDER_ATOMIC);
          var value_position_y = Blockly.JavaScript.valueToCode(block, "position_y", Blockly.JavaScript.ORDER_ATOMIC);
          var value_width = Blockly.JavaScript.valueToCode(block, "width", Blockly.JavaScript.ORDER_ATOMIC);
          var value_height = Blockly.JavaScript.valueToCode(block, "height", Blockly.JavaScript.ORDER_ATOMIC);
          var value_v_x = Blockly.JavaScript.valueToCode(block, "v_x", Blockly.JavaScript.ORDER_ATOMIC);
          var value_v_y = Blockly.JavaScript.valueToCode(block, "v_y", Blockly.JavaScript.ORDER_ATOMIC);
          var value_v_z = Blockly.JavaScript.valueToCode(block, "v_z", Blockly.JavaScript.ORDER_ATOMIC);
          var value_v_w = Blockly.JavaScript.valueToCode(block, "v_w", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "quad(" + value_position_x + "," + value_position_y + "," + value_width + "," + value_height + "," + value_v_x + "," + value_v_y + "," + value_v_z + "," + value_v_w + ");\n";
          return code
      };
      Blockly.JavaScript["yak_shape_rect"] = function (block) {
          var value_x = Blockly.JavaScript.valueToCode(block, "x", Blockly.JavaScript.ORDER_ATOMIC);
          var value_y = Blockly.JavaScript.valueToCode(block, "y", Blockly.JavaScript.ORDER_ATOMIC);
          var value_width = Blockly.JavaScript.valueToCode(block, "width", Blockly.JavaScript.ORDER_ATOMIC);
          var value_height = Blockly.JavaScript.valueToCode(block, "height", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "rect(" + value_x + "," + value_y + "," + value_width + ", " + value_height + ");\n";
          return code
      };
      Blockly.JavaScript["yak_shape_rect5"] = function (block) {
          var value_x = Blockly.JavaScript.valueToCode(block, "v_x", Blockly.JavaScript.ORDER_ATOMIC);
          var value_y = Blockly.JavaScript.valueToCode(block, "v_y", Blockly.JavaScript.ORDER_ATOMIC);
          var value_width = Blockly.JavaScript.valueToCode(block, "v_w", Blockly.JavaScript.ORDER_ATOMIC);
          var value_height = Blockly.JavaScript.valueToCode(block, "v_h", Blockly.JavaScript.ORDER_ATOMIC);
          var value_a = Blockly.JavaScript.valueToCode(block, "v_a", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "rect(" + value_x + "," + value_y + "," + value_width + ", " + value_height + "," + value_a + ");\n";
          return code
      };
      Blockly.JavaScript["yak_shape_rect8"] = function (block) {
          var value_a = Blockly.JavaScript.valueToCode(block, "v_a", Blockly.JavaScript.ORDER_ATOMIC);
          var value_b = Blockly.JavaScript.valueToCode(block, "v_b", Blockly.JavaScript.ORDER_ATOMIC);
          var value_c = Blockly.JavaScript.valueToCode(block, "v_c", Blockly.JavaScript.ORDER_ATOMIC);
          var value_d = Blockly.JavaScript.valueToCode(block, "v_d", Blockly.JavaScript.ORDER_ATOMIC);
          var value_e = Blockly.JavaScript.valueToCode(block, "v_e", Blockly.JavaScript.ORDER_ATOMIC);
          var value_f = Blockly.JavaScript.valueToCode(block, "v_f", Blockly.JavaScript.ORDER_ATOMIC);
          var value_g = Blockly.JavaScript.valueToCode(block, "v_g", Blockly.JavaScript.ORDER_ATOMIC);
          var value_h = Blockly.JavaScript.valueToCode(block, "v_h", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "rect(" + value_a + "," + value_b + "," + value_c + ", " + value_d + "," + value_e + "," + value_f + "," + value_g + "," + value_h + ");\n";
          return code
      };
      Blockly.JavaScript["yak_shape_triangle"] = function (block) {
          var value_position_x = Blockly.JavaScript.valueToCode(block, "position_x", Blockly.JavaScript.ORDER_ATOMIC);
          var value_position_y = Blockly.JavaScript.valueToCode(block, "position_y", Blockly.JavaScript.ORDER_ATOMIC);
          var value_width = Blockly.JavaScript.valueToCode(block, "width", Blockly.JavaScript.ORDER_ATOMIC);
          var value_height = Blockly.JavaScript.valueToCode(block, "height", Blockly.JavaScript.ORDER_ATOMIC);
          var value_v_x = Blockly.JavaScript.valueToCode(block, "v_x", Blockly.JavaScript.ORDER_ATOMIC);
          var value_v_y = Blockly.JavaScript.valueToCode(block, "v_y", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "triangle(" + value_position_x + "," + value_position_y + "," + value_width + ", " + value_height + "," + value_v_x + "," + value_v_y + ");\n";
          return code
      };
      Blockly.JavaScript["yak_rendering_createCanvas"] = function (block) {
          var value_width = Blockly.JavaScript.valueToCode(block, "v_width", Blockly.JavaScript.ORDER_ATOMIC);
          var value_height = Blockly.JavaScript.valueToCode(block, "v_height", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "createCanvas(" + value_width + ", " + value_height + ");\n";
          return code
      };
      Blockly.JavaScript["yak_rendering_createCanvas3D"] = function (block) {
          var value_width = Blockly.JavaScript.valueToCode(block, "v_width", Blockly.JavaScript.ORDER_ATOMIC);
          var value_height = Blockly.JavaScript.valueToCode(block, "v_height", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "createCanvas(" + value_width + ", " + value_height + ", " + "WEBGL" + ");\n";
          return code
      };
      Blockly.JavaScript["yak_rendering_resizeCanvas"] = function (block) {
          var value_width = Blockly.JavaScript.valueToCode(block, "v_width", Blockly.JavaScript.ORDER_ATOMIC);
          var value_height = Blockly.JavaScript.valueToCode(block, "v_height", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "resizeCanvas(" + value_width + ", " + value_height + ");\n";
          return code
      };
      Blockly.JavaScript["yak_rendering_noCanvas"] = function (block) {
          var code = "noCanvas(" + ");\n";
          return code
      };
      Blockly.JavaScript["yak_rendering_createGraphics"] = function (block) {
          var value_width = Blockly.JavaScript.valueToCode(block, "v_width", Blockly.JavaScript.ORDER_ATOMIC);
          var value_height = Blockly.JavaScript.valueToCode(block, "v_height", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "createGraphics(" + value_width + ", " + value_height + ");\n";
          return code
      };
      Blockly.JavaScript["yak_rendering_createGraphics3D"] = function (block) {
          var value_width = Blockly.JavaScript.valueToCode(block, "v_width", Blockly.JavaScript.ORDER_ATOMIC);
          var value_height = Blockly.JavaScript.valueToCode(block, "v_height", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "createGraphics(" + value_width + ", " + value_height + ", " + "WEBGL" + ");\n";
          return code
      };
      Blockly.JavaScript["yak_rendering_blendMode"] = function (block) {
          var dropdown_name = block.getFieldValue("NAME");
          var code = "blendMode(" + dropdown_name + ");\n";
          return code
      };
      Blockly.JavaScript["yak_math_acos"] = function (block) {
          var value_acos = Blockly.JavaScript.valueToCode(block, "v_acos", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "acos(" + value_acos + ");\n";
          return code
      };
      Blockly.JavaScript["yak_math_asin"] = function (block) {
          var value_asin = Blockly.JavaScript.valueToCode(block, "v_asin", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "asin(" + value_asin + ");\n";
          return code
      };
      Blockly.JavaScript["yak_math_atan"] = function (block) {
          var value_atan = Blockly.JavaScript.valueToCode(block, "v_atan", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "atan(" + value_atan + ");\n";
          return code
      };
      Blockly.JavaScript["yak_math_atan2"] = function (block) {
          var value_position_x = Blockly.JavaScript.valueToCode(block, "position_x", Blockly.JavaScript.ORDER_ATOMIC);
          var value_position_y = Blockly.JavaScript.valueToCode(block, "position_y", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "atan2(" + value_position_x + "," + value_position_y + ");\n";
          return code
      };
      Blockly.JavaScript["yak_math_cos"] = function (block) {
          var value_cos = Blockly.JavaScript.valueToCode(block, "v_cos", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "cos(" + value_cos + ")";
          return [code, Blockly.JavaScript.ORDER_ATOMIC]
      };
      Blockly.JavaScript["yak_math_sin"] = function (block) {
          var value_sin = Blockly.JavaScript.valueToCode(block, "v_sin", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "sin(" + value_sin + ")";
          return [code, Blockly.JavaScript.ORDER_ATOMIC]
      };
      Blockly.JavaScript["yak_math_tan"] = function (block) {
          var value_tan = Blockly.JavaScript.valueToCode(block, "v_tan", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "tan(" + value_tan + ");\n";
          return code
      };
      Blockly.JavaScript["yak_math_degrees"] = function (block) {
          var value_degrees = Blockly.JavaScript.valueToCode(block, "v_degrees", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "degrees(" + value_degrees + ");\n";
          return code
      };
      Blockly.JavaScript["yak_math_radians"] = function (block) {
          var value_radians = Blockly.JavaScript.valueToCode(block, "v_radians", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "radians(" + value_radians + ")";
          return [code, Blockly.JavaScript.ORDER_ATOMIC]
      };
      Blockly.JavaScript["yak_math_angleMode"] = function (block) {
          var dropdown_name = block.getFieldValue("NAME");
          var code = "angleMode(" + dropdown_name + ");\n";
          return code
      };
      Blockly.JavaScript["yak_math_randomSeed"] = function (block) {
          var value_randomSeed = Blockly.JavaScript.valueToCode(block, "v_randomSeed", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "randomSeed(" + value_randomSeed + ");\n";
          return code
      };
      Blockly.JavaScript["yak_math_random"] = function (block) {
          var value_random = Blockly.JavaScript.valueToCode(block, "v_random", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "random(" + value_random + ")";
          return [code, Blockly.JavaScript.ORDER_ATOMIC]
      };
      Blockly.JavaScript["yak_math_random_mx"] = function (block) {
          var value_position_x = Blockly.JavaScript.valueToCode(block, "position_x", Blockly.JavaScript.ORDER_ATOMIC);
          var value_position_y = Blockly.JavaScript.valueToCode(block, "position_y", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "random(" + value_position_x + "," + value_position_y + ")";
          return [code, Blockly.JavaScript.ORDER_ATOMIC]
      };
      Blockly.JavaScript["yak_math_randomGaussian"] = function (block) {
          var value_position_x = Blockly.JavaScript.valueToCode(block, "position_x", Blockly.JavaScript.ORDER_ATOMIC);
          var value_position_y = Blockly.JavaScript.valueToCode(block, "position_y", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "randomGaussian(" + value_position_x + "," + value_position_y + ");\n";
          return code
      };
      Blockly.JavaScript["yak_math_noise"] = function (block) {
          var value_position_x = Blockly.JavaScript.valueToCode(block, "position_x", Blockly.JavaScript.ORDER_ATOMIC);
          var value_position_y = Blockly.JavaScript.valueToCode(block, "position_y", Blockly.JavaScript.ORDER_ATOMIC);
          var value_width = Blockly.JavaScript.valueToCode(block, "width", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "noise(" + value_position_x + "," + value_position_y + "," + value_width + ");\n";
          return code
      };
      Blockly.JavaScript["yak_math_noiseDetail"] = function (block) {
          var value_position_x = Blockly.JavaScript.valueToCode(block, "position_x", Blockly.JavaScript.ORDER_ATOMIC);
          var value_position_y = Blockly.JavaScript.valueToCode(block, "position_y", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "noiseDetail(" + value_position_x + "," + value_position_y + ");\n";
          return code
      };
      Blockly.JavaScript["yak_math_noiseSeed"] = function (block) {
          var value_min = Blockly.JavaScript.valueToCode(block, "v_noiseSeed", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "noiseSeed(" + value_min + ");\n";
          return code
      };
      Blockly.JavaScript["yak_math_abs"] = function (block) {
          var value_abs = Blockly.JavaScript.valueToCode(block, "v_abs", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "abs(" + value_abs + ")";
          return [code, Blockly.JavaScript.ORDER_ATOMIC]
      };
      Blockly.JavaScript["yak_math_ceil"] = function (block) {
          var value_ceil = Blockly.JavaScript.valueToCode(block, "v_ceil", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "ceil(" + value_ceil + ");\n";
          return code
      };
      Blockly.JavaScript["yak_math_constrain"] = function (block) {
          var value_position_x = Blockly.JavaScript.valueToCode(block, "position_x", Blockly.JavaScript.ORDER_ATOMIC);
          var value_position_y = Blockly.JavaScript.valueToCode(block, "position_y", Blockly.JavaScript.ORDER_ATOMIC);
          var value_width = Blockly.JavaScript.valueToCode(block, "width", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "constrain(" + value_position_x + "," + value_position_y + "," + value_width + ");\n";
          return code
      };
      Blockly.JavaScript["yak_math_dist"] = function (block) {
          var value_position_x = Blockly.JavaScript.valueToCode(block, "position_x", Blockly.JavaScript.ORDER_ATOMIC);
          var value_position_y = Blockly.JavaScript.valueToCode(block, "position_y", Blockly.JavaScript.ORDER_ATOMIC);
          var value_width = Blockly.JavaScript.valueToCode(block, "width", Blockly.JavaScript.ORDER_ATOMIC);
          var value_height = Blockly.JavaScript.valueToCode(block, "height", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "dist(" + value_position_x + "," + value_position_y + "," + value_width + "," + value_height + ")";
          return [code, Blockly.JavaScript.ORDER_ATOMIC]
      };
      Blockly.JavaScript["yak_math_exp"] = function (block) {
          var value_exp = Blockly.JavaScript.valueToCode(block, "v_exp", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "exp(" + value_exp + ");\n";
          return code
      };
      Blockly.JavaScript["yak_math_floor"] = function (block) {
          var value_floor = Blockly.JavaScript.valueToCode(block, "v_floor", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "floor(" + value_floor + ");\n";
          return code
      };
      Blockly.JavaScript["yak_math_lerp"] = function (block) {
          var value_position_x = Blockly.JavaScript.valueToCode(block, "position_x", Blockly.JavaScript.ORDER_ATOMIC);
          var value_position_y = Blockly.JavaScript.valueToCode(block, "position_y", Blockly.JavaScript.ORDER_ATOMIC);
          var value_width = Blockly.JavaScript.valueToCode(block, "width", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "lerp(" + value_position_x + "," + value_position_y + "," + value_width + ");\n";
          return code
      };
      Blockly.JavaScript["yak_math_log"] = function (block) {
          var value_log = Blockly.JavaScript.valueToCode(block, "v_log", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "log(" + value_log + ");\n";
          return code
      };
      Blockly.JavaScript["yak_math_mag"] = function (block) {
          var value_a = Blockly.JavaScript.valueToCode(block, "v_a", Blockly.JavaScript.ORDER_ATOMIC);
          var value_b = Blockly.JavaScript.valueToCode(block, "v_b", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "mag(" + value_a + "," + value_b + ");\n";
          return code
      };
      Blockly.JavaScript["yak_math_map"] = function (block) {
          var value_position_x = Blockly.JavaScript.valueToCode(block, "position_x", Blockly.JavaScript.ORDER_ATOMIC);
          var value_position_y = Blockly.JavaScript.valueToCode(block, "position_y", Blockly.JavaScript.ORDER_ATOMIC);
          var value_width = Blockly.JavaScript.valueToCode(block, "width", Blockly.JavaScript.ORDER_ATOMIC);
          var value_height = Blockly.JavaScript.valueToCode(block, "height", Blockly.JavaScript.ORDER_ATOMIC);
          var value_v_x = Blockly.JavaScript.valueToCode(block, "v_x", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "map(" + value_position_x + "," + value_position_y + "," + value_width + "," + value_height + "," + value_v_x + ")";
          return [code, Blockly.JavaScript.ORDER_ATOMIC]
      };
      Blockly.JavaScript["yak_math_max"] = function (block) {
          var value_log = Blockly.JavaScript.valueToCode(block, "v_max", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "max(" + value_log + ");\n";
          return code
      };
      Blockly.JavaScript["yak_math_min"] = function (block) {
          var value_min = Blockly.JavaScript.valueToCode(block, "v_min", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "min(" + value_min + ");\n";
          return code
      };
      Blockly.JavaScript["yak_math_norm"] = function (block) {
          var value_position_x = Blockly.JavaScript.valueToCode(block, "position_x", Blockly.JavaScript.ORDER_ATOMIC);
          var value_position_y = Blockly.JavaScript.valueToCode(block, "position_y", Blockly.JavaScript.ORDER_ATOMIC);
          var value_width = Blockly.JavaScript.valueToCode(block, "width", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "norm(" + value_position_x + "," + value_position_y + "," + value_width + ");\n";
          return code
      };
      Blockly.JavaScript["yak_math_pow"] = function (block) {
          var value_position_x = Blockly.JavaScript.valueToCode(block, "position_x", Blockly.JavaScript.ORDER_ATOMIC);
          var value_position_y = Blockly.JavaScript.valueToCode(block, "position_y", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "pow(" + value_position_x + "," + value_position_y + ");\n";
          return [code, Blockly.JavaScript.ORDER_ATOMIC]
      };
      Blockly.JavaScript["yak_math_min"] = function (block) {
          var value_round = Blockly.JavaScript.valueToCode(block, "v_round", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "round(" + value_round + ");\n";
          return code
      };
      Blockly.JavaScript["yak_math_sq"] = function (block) {
          var value_sq = Blockly.JavaScript.valueToCode(block, "v_sq", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "sq(" + value_sq + ");\n";
          return code
      };
      Blockly.JavaScript["yak_math_sqrt"] = function (block) {
          var value_sqrt = Blockly.JavaScript.valueToCode(block, "v_sqrt", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "sqrt(" + value_sqrt + ");\n";
          return code
      };
      Blockly.JavaScript["graph_get_y"] = function (block) {
          return ["y", Blockly.JavaScript.ORDER_ATOMIC]
      };
      Blockly.JavaScript["graph_get_x"] = function (block) {
          return ["x", Blockly.JavaScript.ORDER_ATOMIC]
      };
      Blockly.JavaScript["graph_set_y"] = function (block) {
          var argument0 = Blockly.JavaScript.valueToCode(block, "VALUE", Blockly.JavaScript.ORDER_ASSIGNMENT) || "";
          return "y = " + argument0 + ";\n"
      };
      Blockly.JavaScript["graph_set_x"] = function (block) {
          var argument0 = Blockly.JavaScript.valueToCode(block, "VALUE", Blockly.JavaScript.ORDER_ASSIGNMENT) || "";
          return "x = " + argument0 + ";\n"
      };
      Blockly.JavaScript["graph_get_a"] = function (block) {
          return ["a", Blockly.JavaScript.ORDER_ATOMIC]
      };
      Blockly.JavaScript["graph_set_a"] = function (block) {
          var argument0 = Blockly.JavaScript.valueToCode(block, "VALUE", Blockly.JavaScript.ORDER_ASSIGNMENT) || "";
          return "a = " + argument0 + ";\n"
      };
      Blockly.JavaScript["graph_get_num"] = function (block) {
          return ["num", Blockly.JavaScript.ORDER_ATOMIC]
      };
      Blockly.JavaScript["graph_set_num"] = function (block) {
          var argument0 = Blockly.JavaScript.valueToCode(block, "VALUE", Blockly.JavaScript.ORDER_ASSIGNMENT) || "";
          return "num = " + argument0 + ";\n"
      };
      Blockly.JavaScript["graph_get_theta"] = function (block) {
          return ["theta", Blockly.JavaScript.ORDER_ATOMIC]
      };
      Blockly.JavaScript["graph_set_theta"] = function (block) {
          var argument0 = Blockly.JavaScript.valueToCode(block, "VALUE", Blockly.JavaScript.ORDER_ASSIGNMENT) || "";
          return "theta = " + argument0 + ";\n"
      };
      Blockly.JavaScript["graph_get_sz"] = function (block) {
          return ["sz", Blockly.JavaScript.ORDER_ATOMIC]
      };
      Blockly.JavaScript["graph_set_sz"] = function (block) {
          var argument0 = Blockly.JavaScript.valueToCode(block, "VALUE", Blockly.JavaScript.ORDER_ASSIGNMENT) || "";
          return "sz = " + argument0 + ";\n"
      };
      Blockly.JavaScript["graph_set_angle"] = function (block) {
          var argument0 = Blockly.JavaScript.valueToCode(block, "VALUE", Blockly.JavaScript.ORDER_ASSIGNMENT) || "";
          return "angle = " + argument0 + ";\n"
      };
      Blockly.JavaScript["graph_get_angle"] = function (block) {
          return ["angle", Blockly.JavaScript.ORDER_ATOMIC]
      };
      Blockly.JavaScript["graph_set_beat"] = function (block) {
          var argument0 = Blockly.JavaScript.valueToCode(block, "VALUE", Blockly.JavaScript.ORDER_ASSIGNMENT) || "";
          return "beat = " + argument0 + ";\n"
      };
      Blockly.JavaScript["graph_get_beat"] = function (block) {
          return ["beat", Blockly.JavaScript.ORDER_ATOMIC]
      };
      Blockly.JavaScript["graph_set_distance"] = function (block) {
          var argument0 = Blockly.JavaScript.valueToCode(block, "VALUE", Blockly.JavaScript.ORDER_ASSIGNMENT) || "";
          return "distance = " + argument0 + ";\n"
      };
      Blockly.JavaScript["graph_get_distance"] = function (block) {
          return ["distance", Blockly.JavaScript.ORDER_ATOMIC]
      };
      Blockly.JavaScript["graph_set_heart"] = function (block) {
          var argument0 = Blockly.JavaScript.valueToCode(block, "VALUE", Blockly.JavaScript.ORDER_ASSIGNMENT) || "";
          return "heart(" + argument0 + ");\n"
      };
      Blockly.JavaScript["yak_typography_text"] = function (block) {
          var value_position_x = Blockly.JavaScript.valueToCode(block, "position_x", Blockly.JavaScript.ORDER_ATOMIC);
          var value_position_y = Blockly.JavaScript.valueToCode(block, "position_y", Blockly.JavaScript.ORDER_ATOMIC);
          var value_width = Blockly.JavaScript.valueToCode(block, "width", Blockly.JavaScript.ORDER_ATOMIC);
          var value_height = Blockly.JavaScript.valueToCode(block, "height", Blockly.JavaScript.ORDER_ATOMIC);
          var value_v_x = Blockly.JavaScript.valueToCode(block, "v_x", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "text(" + value_position_x + "," + value_position_y + "," + value_width + ", " + value_height + "," + value_v_x + ");\n";
          return code
      };
      Blockly.JavaScript["yak_typography_textFont"] = function (block) {
          var value_textFont = Blockly.JavaScript.valueToCode(block, "v_textFont", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "textFont(" + value_textFont + ");\n";
          return code
      };
      Blockly.JavaScript["yak_event_key_constants"] = function (block) {
          var dropdown_name = block.getFieldValue("NAME");
          var code = dropdown_name;
          return [code, Blockly.JavaScript.ORDER_ATOMIC]
      };
      Blockly.JavaScript["yak_event_keyPressed"] = function (block) {
          var value_draw = Blockly.JavaScript.statementToCode(block, "DO", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "keyPressed=function(){\n" + value_draw + "};\n";
          return code
      };
      Blockly.JavaScript["yak_event_keyReleased"] = function (block) {
          var value_draw = Blockly.JavaScript.statementToCode(block, "DO", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "keyReleased=function(){\n" + value_draw + "};\n";
          return code
      };
      Blockly.JavaScript["yak_event_keyIsDown"] = function (block) {
          var value_background = Blockly.JavaScript.valueToCode(block, "v_keyIsDown", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "keyIsDown(" + value_background + ");\n";
          return code
      };
      Blockly.JavaScript["yak_typography_textAlign"] = function (block) {
          var dropdown_name = block.getFieldValue("NAME");
          var dropdown_name2 = block.getFieldValue("NAME2");
          var code = "textAlign(" + dropdown_name + "," + dropdown_name2 + ");\n";
          return code
      };
      Blockly.JavaScript["yak_typography_textLeading"] = function (block) {
          var value_textLeading = Blockly.JavaScript.valueToCode(block, "v_textLeading", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "textLeading(" + value_textLeading + ");\n";
          return code
      };
      Blockly.JavaScript["yak_typography_textSize"] = function (block) {
          var value_textSize = Blockly.JavaScript.valueToCode(block, "v_textSize", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "textSize(" + value_textSize + ");\n";
          return code
      };
      Blockly.JavaScript["yak_typography_textStyle"] = function (block) {
          var dropdown_name = block.getFieldValue("NAME");
          var code = "textStyle(" + dropdown_name + ");\n";
          return code
      };
      Blockly.JavaScript["yak_typography_textWidth"] = function (block) {
          var value_textWidth = Blockly.JavaScript.valueToCode(block, "v_textWidth", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "textWidth(" + value_textWidth + ");\n";
          return code
      };
      Blockly.JavaScript["yak_event_system_constants"] = function (block) {
          var dropdown_name = block.getFieldValue("NAME");
          var code = dropdown_name;
          return [code, Blockly.JavaScript.ORDER_ATOMIC]
      };
      Blockly.JavaScript["yak_event_rotation_constants"] = function (block) {
          var dropdown_name = block.getFieldValue("NAME");
          var code = dropdown_name;
          return [code, Blockly.JavaScript.ORDER_ATOMIC]
      };
      Blockly.JavaScript["yak_events_setMoveThreshold"] = function (block) {
          var value_setMoveThreshold = Blockly.JavaScript.valueToCode(block, "v_setMoveThreshold", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "setMoveThreshold(" + value_setMoveThreshold + ");\n";
          return code
      };
      Blockly.JavaScript["yak_events_setShakeThreshold"] = function (block) {
          var value_setShakeThreshold = Blockly.JavaScript.valueToCode(block, "v_setShakeThreshold", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "setShakeThreshold(" + value_setShakeThreshold + ");\n";
          return code
      };
      Blockly.JavaScript["yak_events_deviceMoved"] = function (block) {
          var value_draw = Blockly.JavaScript.statementToCode(block, "DO", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "deviceMoved=function(){\n" + value_draw + "};\n";
          return code
      };
      Blockly.JavaScript["yak_events_deviceTurned"] = function (block) {
          var value_draw = Blockly.JavaScript.statementToCode(block, "DO", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "deviceTurned=function(){\n" + value_draw + "};\n";
          return code
      };
      Blockly.JavaScript["yak_events_deviceShaken"] = function (block) {
          var value_draw = Blockly.JavaScript.statementToCode(block, "DO", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "deviceShaken=function(){\n" + value_draw + "};\n";
          return code
      };
      Blockly.JavaScript["yak_transform_applyMatrix"] = function (block) {
          var value_position_x = Blockly.JavaScript.valueToCode(block, "position_x", Blockly.JavaScript.ORDER_ATOMIC);
          var value_position_y = Blockly.JavaScript.valueToCode(block, "position_y", Blockly.JavaScript.ORDER_ATOMIC);
          var value_width = Blockly.JavaScript.valueToCode(block, "width", Blockly.JavaScript.ORDER_ATOMIC);
          var value_height = Blockly.JavaScript.valueToCode(block, "height", Blockly.JavaScript.ORDER_ATOMIC);
          var value_v_x = Blockly.JavaScript.valueToCode(block, "v_x", Blockly.JavaScript.ORDER_ATOMIC);
          var value_v_y = Blockly.JavaScript.valueToCode(block, "v_y", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "applyMatrix(" + value_position_x + "," + value_position_y + "," + value_width + ", " + value_height + "," + value_v_x + "," + value_v_y + ");\n";
          return code
      };
      Blockly.JavaScript["yak_transform_resetMatrix"] = function (block) {
          var code = "resetMatrix(" + ");\n";
          return code
      };
      Blockly.JavaScript["yak_transform_rotate"] = function (block) {
          var value_rotate = Blockly.JavaScript.valueToCode(block, "v_rotate", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "rotate(" + value_rotate + ");\n";
          return code
      };
      Blockly.JavaScript["yak_transform_rotate_rad"] = function (block) {
          var value_v_x = Blockly.JavaScript.valueToCode(block, "v_x", Blockly.JavaScript.ORDER_ATOMIC);
          var value_v_y = Blockly.JavaScript.valueToCode(block, "v_y", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "rotate(" + value_v_x + "," + value_v_y + ");\n";
          return code
      };
      Blockly.JavaScript["yak_transform_rotate_new"] = function (block) {
          var value_v_x = Blockly.JavaScript.valueToCode(block, "v_x", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "rotate(" + value_v_x + ");\n";
          return code
      };
      Blockly.JavaScript["yak_transform_rotateX"] = function (block) {
          var value_rotateX = Blockly.JavaScript.valueToCode(block, "v_rotateX", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "rotateX(" + value_rotateX + ");\n";
          return code
      };
      Blockly.JavaScript["yak_transform_rotateY"] = function (block) {
          var value_rotateY = Blockly.JavaScript.valueToCode(block, "v_rotateY", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "rotateY(" + value_rotateY + ");\n";
          return code
      };
      Blockly.JavaScript["yak_transform_rotateZ"] = function (block) {
          var value_rotateZ = Blockly.JavaScript.valueToCode(block, "v_rotateZ", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "rotateZ(" + value_rotateZ + ");\n";
          return code
      };
      Blockly.JavaScript["yak_transform_scale"] = function (block) {
          var value_scale = Blockly.JavaScript.valueToCode(block, "v_scale", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "scale(" + value_scale + ");\n";
          return code
      };
      Blockly.JavaScript["yak_transform_scale2"] = function (block) {
          var value_x = Blockly.JavaScript.valueToCode(block, "v_x", Blockly.JavaScript.ORDER_ATOMIC);
          var value_y = Blockly.JavaScript.valueToCode(block, "v_y", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "scale(" + value_x + value_y + ");\n";
          return code
      };
      Blockly.JavaScript["yak_transform_shearX"] = function (block) {
          var value_shearX = Blockly.JavaScript.valueToCode(block, "v_shearX", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "shearX(" + value_shearX + ");\n";
          return code
      };
      Blockly.JavaScript["yak_transform_shearY"] = function (block) {
          var value_shearX = Blockly.JavaScript.valueToCode(block, "v_shearX", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "shearY(" + value_shearX + ");\n";
          return code
      };
      Blockly.JavaScript["yak_transform_translate"] = function (block) {
          var value_v_x = Blockly.JavaScript.valueToCode(block, "v_x", Blockly.JavaScript.ORDER_ATOMIC);
          var value_v_y = Blockly.JavaScript.valueToCode(block, "v_y", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "translate(" + value_v_x + "," + value_v_y + ");\n";
          return code
      };
      Blockly.JavaScript["yak_environment_print"] = function (block) {
          var msg = Blockly.JavaScript.valueToCode(block, "TEXT", Blockly.JavaScript.ORDER_NONE) || "''";
          return "print(" + msg + ");\n"
      };
      Blockly.JavaScript["yak_environment_frameCount"] = function (block) {
          var code = "frameCount";
          return [code, Blockly.JavaScript.ORDER_ATOMIC]
      };
      Blockly.JavaScript["yak_environment_focused"] = function (block) {
          var code = "focused";
          return [code, Blockly.JavaScript.ORDER_ATOMIC]
      };
      Blockly.JavaScript["yak_environment_cursor"] = function (block) {
          var dropdown_name = block.getFieldValue("NAME");
          var code = "cursor(" + dropdown_name + ");\n";
          return code
      };
      Blockly.JavaScript["yak_environment_frameRate"] = function (block) {
          var value_frameRate = Blockly.JavaScript.valueToCode(block, "v_frameRate", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "frameRate(" + value_frameRate + ");\n";
          return code
      };
      Blockly.JavaScript["yak_environment_noCursor"] = function (block) {
          var code = "noCursor(" + ");\n";
          return code
      };
      Blockly.JavaScript["yak_environment_width_height"] = function (block) {
          var dropdown_name = block.getFieldValue("NAME");
          var code = dropdown_name;
          return [code, Blockly.JavaScript.ORDER_ATOMIC]
      };
      Blockly.JavaScript["yak_structure_windowResized"] = function (block) {
          var value_set = Blockly.JavaScript.statementToCode(block, "DO", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "windowResized=function(){\n" + value_set + "};\n";
          return code
      };
      Blockly.JavaScript["yak_environment_fullscreen"] = function (block) {
          var value_frameRate = Blockly.JavaScript.valueToCode(block, "v_fullscreen", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "fullscreen(" + value_frameRate + ");\n";
          return code
      };
      Blockly.JavaScript["yak_environment_pixelDensity"] = function (block) {
          var value_pixelDensity = Blockly.JavaScript.valueToCode(block, "v_pixelDensity", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "pixelDensity(" + value_pixelDensity + ");\n";
          return code
      };
      Blockly.JavaScript["yak_environment_displayDensity"] = function (block) {
          var code = "displayDensity(" + ");\n";
          return code
      };
      Blockly.JavaScript["yak_environment_getURL"] = function (block) {
          var code = "getURL(" + ");\n";
          return code
      };
      Blockly.JavaScript["yak_environment_getURLPath"] = function (block) {
          var code = "getURLPath(" + ");\n";
          return code
      };
      Blockly.JavaScript["yak_environment_getURLParams"] = function (block) {
          var code = "getURLParams(" + ");\n";
          return code
      };
      Blockly.JavaScript["yak_structure_preload"] = function (block) {
          var value_set = Blockly.JavaScript.statementToCode(block, "DO", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "preload=function(){\n" + value_set + "};\n";
          return code
      };
      Blockly.JavaScript["yak_structure_setup"] = function (block) {
          var value_set = Blockly.JavaScript.statementToCode(block, "DO", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "function setup(){\n" + value_set + "};\n";
          return code
      };
      Blockly.JavaScript["yak_structure_draw"] = function (block) {
          var value_draw = Blockly.JavaScript.statementToCode(block, "DO", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "function draw(){\n" + value_draw + "};\n";
          return code
      };
      Blockly.JavaScript["yak_structure_remove"] = function (block) {
          var code = "remove(" + ");\n";
          return code
      };
      Blockly.JavaScript["yak_structure_noLoop"] = function (block) {
          var code = "noLoop(" + ");\n";
          return code
      };
      Blockly.JavaScript["yak_structure_loop"] = function (block) {
          var code = "loop(" + ");\n";
          return code
      };
      Blockly.JavaScript["yak_structure_push"] = function (block) {
          var code = "push(" + ");\n";
          return code
      };
      Blockly.JavaScript["yak_structure_pop"] = function (block) {
          var code = "pop(" + ");\n";
          return code
      };
      Blockly.JavaScript["yak_structure_redraw"] = function (block) {
          var value_redraw = Blockly.JavaScript.valueToCode(block, "v_redraw", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "redraw(" + value_redraw + ");\n";
          return code
      };
      Blockly.JavaScript["yak_data_join"] = function (block) {
          var value_v_x = Blockly.JavaScript.valueToCode(block, "v_x", Blockly.JavaScript.ORDER_ATOMIC);
          var value_v_y = Blockly.JavaScript.valueToCode(block, "v_y", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "join(" + value_v_x + "," + value_v_y + ");\n";
          return code
      };
      Blockly.JavaScript["yak_data_match"] = function (block) {
          var value_v_x = Blockly.JavaScript.valueToCode(block, "v_x", Blockly.JavaScript.ORDER_ATOMIC);
          var value_v_y = Blockly.JavaScript.valueToCode(block, "v_y", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "match(" + value_v_x + "," + value_v_y + ");\n";
          return code
      };
      Blockly.JavaScript["yak_data_matchAll"] = function (block) {
          var value_v_x = Blockly.JavaScript.valueToCode(block, "v_x", Blockly.JavaScript.ORDER_ATOMIC);
          var value_v_y = Blockly.JavaScript.valueToCode(block, "v_y", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "matchAll(" + value_v_x + "," + value_v_y + ");\n";
          return code
      };
      Blockly.JavaScript["yak_data_nf"] = function (block) {
          var value_v_x = Blockly.JavaScript.valueToCode(block, "v_x", Blockly.JavaScript.ORDER_ATOMIC);
          var value_v_y = Blockly.JavaScript.valueToCode(block, "v_y", Blockly.JavaScript.ORDER_ATOMIC);
          var value_v_z = Blockly.JavaScript.valueToCode(block, "v_z", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "nf(" + value_v_x + "," + value_v_y + "," + value_v_z + ");\n";
          return code
      };
      Blockly.JavaScript["yak_data_nfc"] = function (block) {
          var value_v_x = Blockly.JavaScript.valueToCode(block, "v_x", Blockly.JavaScript.ORDER_ATOMIC);
          var value_v_y = Blockly.JavaScript.valueToCode(block, "v_y", Blockly.JavaScript.ORDER_ATOMIC);
          var value_v_z = Blockly.JavaScript.valueToCode(block, "v_z", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "nf(" + value_v_x + "," + value_v_y + "," + value_v_z + ");\n";
          return code
      };
      Blockly.JavaScript["yak_data_nfp"] = function (block) {
          var value_v_x = Blockly.JavaScript.valueToCode(block, "v_x", Blockly.JavaScript.ORDER_ATOMIC);
          var value_v_y = Blockly.JavaScript.valueToCode(block, "v_y", Blockly.JavaScript.ORDER_ATOMIC);
          var value_v_z = Blockly.JavaScript.valueToCode(block, "v_z", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "nfp(" + value_v_x + "," + value_v_y + "," + value_v_z + ");\n";
          return code
      };
      Blockly.JavaScript["yak_data_nfc"] = function (block) {
          var value_v_x = Blockly.JavaScript.valueToCode(block, "v_x", Blockly.JavaScript.ORDER_ATOMIC);
          var value_v_y = Blockly.JavaScript.valueToCode(block, "v_y", Blockly.JavaScript.ORDER_ATOMIC);
          var value_v_z = Blockly.JavaScript.valueToCode(block, "v_z", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "nfc(" + value_v_x + "," + value_v_y + "," + value_v_z + ");\n";
          return code
      };
      Blockly.JavaScript["yak_data_split"] = function (block) {
          var value_v_x = Blockly.JavaScript.valueToCode(block, "v_x", Blockly.JavaScript.ORDER_ATOMIC);
          var value_v_y = Blockly.JavaScript.valueToCode(block, "v_y", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "split(" + value_v_x + "," + value_v_y + ");\n";
          return code
      };
      Blockly.JavaScript["yak_data_splitTokens"] = function (block) {
          var value_v_x = Blockly.JavaScript.valueToCode(block, "v_x", Blockly.JavaScript.ORDER_ATOMIC);
          var value_v_y = Blockly.JavaScript.valueToCode(block, "v_y", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "splitTokens(" + value_v_x + "," + value_v_y + ");\n";
          return code
      };
      Blockly.JavaScript["yak_data_trim"] = function (block) {
          var value_v_x = Blockly.JavaScript.valueToCode(block, "v_x", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "trim(" + value_v_x + ");\n";
          return code
      };
      Blockly.JavaScript["yak_data_float"] = function (block) {
          var value_float = Blockly.JavaScript.valueToCode(block, "v_float", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "float(" + value_float + ");\n";
          return code
      };
      Blockly.JavaScript["yak_data_int"] = function (block) {
          var value_int = Blockly.JavaScript.valueToCode(block, "v_int", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "int(" + value_int + ");\n";
          return code
      };
      Blockly.JavaScript["yak_data_str"] = function (block) {
          var value_str = Blockly.JavaScript.valueToCode(block, "v_str", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "str(" + value_str + ");\n";
          return code
      };
      Blockly.JavaScript["yak_data_boolean"] = function (block) {
          var value_boolean = Blockly.JavaScript.valueToCode(block, "v_boolean", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "boolean(" + value_boolean + ");\n";
          return code
      };
      Blockly.JavaScript["yak_data_byte"] = function (block) {
          var value_byte = Blockly.JavaScript.valueToCode(block, "v_byte", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "byte(" + value_byte + ");\n";
          return code
      };
      Blockly.JavaScript["yak_data_char"] = function (block) {
          var value_char = Blockly.JavaScript.valueToCode(block, "v_char", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "char(" + value_char + ");\n";
          return code
      };
      Blockly.JavaScript["yak_data_unchar"] = function (block) {
          var value_unchar = Blockly.JavaScript.valueToCode(block, "v_unchar", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "unchar(" + value_unchar + ");\n";
          return code
      };
      Blockly.JavaScript["yak_data_hex"] = function (block) {
          var value_hex = Blockly.JavaScript.valueToCode(block, "v_hex", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "hex(" + value_hex + ");\n";
          return code
      };
      Blockly.JavaScript["yak_data_unhex"] = function (block) {
          var value_unhex = Blockly.JavaScript.valueToCode(block, "v_unhex", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "unhex(" + value_unhex + ");\n";
          return code
      };
      Blockly.JavaScript["yak_data_append"] = function (block) {
          var value_v_x = Blockly.JavaScript.valueToCode(block, "v_x", Blockly.JavaScript.ORDER_ATOMIC);
          var value_v_y = Blockly.JavaScript.valueToCode(block, "v_y", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "append(" + value_v_x + "," + value_v_y + ");\n";
          return code
      };
      Blockly.JavaScript["yak_data_arrayCopy"] = function (block) {
          var value_position_x = Blockly.JavaScript.valueToCode(block, "position_x", Blockly.JavaScript.ORDER_ATOMIC);
          var value_position_y = Blockly.JavaScript.valueToCode(block, "position_y", Blockly.JavaScript.ORDER_ATOMIC);
          var value_width = Blockly.JavaScript.valueToCode(block, "width", Blockly.JavaScript.ORDER_ATOMIC);
          var value_height = Blockly.JavaScript.valueToCode(block, "height", Blockly.JavaScript.ORDER_ATOMIC);
          var value_v_x = Blockly.JavaScript.valueToCode(block, "v_x", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "arrayCopy(" + value_position_x + "," + value_position_y + "," + value_width + ", " + value_height + "," + value_v_x + ");\n";
          return code
      };
      Blockly.JavaScript["yak_data_concat"] = function (block) {
          var value_v_x = Blockly.JavaScript.valueToCode(block, "v_x", Blockly.JavaScript.ORDER_ATOMIC);
          var value_v_y = Blockly.JavaScript.valueToCode(block, "v_y", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "concat(" + value_v_x + "," + value_v_y + ");\n";
          return code
      };
      Blockly.JavaScript["yak_data_reverse"] = function (block) {
          var value_reverse = Blockly.JavaScript.valueToCode(block, "v_reverse", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "reverse(" + value_reverse + ");\n";
          return code
      };
      Blockly.JavaScript["yak_data_shorten"] = function (block) {
          var value_shorten = Blockly.JavaScript.valueToCode(block, "v_shorten", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "shorten(" + value_shorten + ");\n";
          return code
      };
      Blockly.JavaScript["yak_data_shuffle"] = function (block) {
          var value_shuffle = Blockly.JavaScript.valueToCode(block, "v_shuffle", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "shuffle(" + value_shuffle + ");\n";
          return code
      };
      Blockly.JavaScript["yak_data_sort"] = function (block) {
          var value_v_x = Blockly.JavaScript.valueToCode(block, "v_x", Blockly.JavaScript.ORDER_ATOMIC);
          var value_v_y = Blockly.JavaScript.valueToCode(block, "v_y", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "sort(" + value_v_x + "," + value_v_y + ");\n";
          return code
      };
      Blockly.JavaScript["yak_data_splice"] = function (block) {
          var value_v_x = Blockly.JavaScript.valueToCode(block, "v_x", Blockly.JavaScript.ORDER_ATOMIC);
          var value_v_y = Blockly.JavaScript.valueToCode(block, "v_y", Blockly.JavaScript.ORDER_ATOMIC);
          var value_v_z = Blockly.JavaScript.valueToCode(block, "v_z", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "splice(" + value_v_x + "," + value_v_y + "," + value_v_z + ");\n";
          return code
      };
      Blockly.JavaScript["yak_data_subset"] = function (block) {
          var value_v_x = Blockly.JavaScript.valueToCode(block, "v_x", Blockly.JavaScript.ORDER_ATOMIC);
          var value_v_y = Blockly.JavaScript.valueToCode(block, "v_y", Blockly.JavaScript.ORDER_ATOMIC);
          var value_v_z = Blockly.JavaScript.valueToCode(block, "v_z", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "subset(" + value_v_x + "," + value_v_y + "," + value_v_z + ");\n";
          return code
      };
      Blockly.JavaScript["yak_constants"] = function (block) {
          var dropdown_name = block.getFieldValue("NAME");
          var code = dropdown_name;
          return [code, Blockly.JavaScript.ORDER_ATOMIC]
      };
      Blockly.JavaScript["yak_color_background_gray"] = function (block) {
          var value_background = Blockly.JavaScript.valueToCode(block, "v_background", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "background(" + "'" + value_background + "'" + ");\n";
          return code
      };
      Blockly.JavaScript["yak_color_background_color"] = function (block) {
          var value_background = Blockly.JavaScript.valueToCode(block, "v_background", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "background(" + value_background + ");\n";
          return code
      };
      Blockly.JavaScript["yak_color_background"] = function (block) {
          var value_v_x = Blockly.JavaScript.valueToCode(block, "v_x", Blockly.JavaScript.ORDER_ATOMIC);
          var value_v_y = Blockly.JavaScript.valueToCode(block, "v_y", Blockly.JavaScript.ORDER_ATOMIC);
          var value_v_z = Blockly.JavaScript.valueToCode(block, "v_z", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "background(" + value_v_x + "," + value_v_y + "," + value_v_z + ");\n";
          return code
      };
      Blockly.JavaScript["yak_color_clear"] = function (block) {
          var code = "clear(" + ");\n";
          return code
      };
      Blockly.JavaScript["yak_color_colorMode"] = function (block) {
          var dropdown_name = block.getFieldValue("NAME");
          var code = "colorMode(" + dropdown_name + ");\n";
          return code
      };
      Blockly.JavaScript["yak_color_fill"] = function (block) {
          var value_fill = Blockly.JavaScript.valueToCode(block, "v_fill", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "fill(" + value_fill + ");\n";
          return code
      };
      Blockly.JavaScript["yak_color_fillRGB"] = function (block) {
          var value_x = Blockly.JavaScript.valueToCode(block, "v_x", Blockly.JavaScript.ORDER_ATOMIC);
          var value_y = Blockly.JavaScript.valueToCode(block, "v_y", Blockly.JavaScript.ORDER_ATOMIC);
          var value_z = Blockly.JavaScript.valueToCode(block, "v_z", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "fill(" + value_x + "," + value_y + "," + value_z + ");\n";
          return code
      };
      Blockly.JavaScript["yak_color_fill2"] = function (block) {
          var value_x = Blockly.JavaScript.valueToCode(block, "v_x", Blockly.JavaScript.ORDER_ATOMIC);
          var value_y = Blockly.JavaScript.valueToCode(block, "v_y", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "fill(" + value_x + "," + value_y + ");\n";
          return code
      };
      Blockly.JavaScript["yak_color_fill4"] = function (block) {
          var value_x = Blockly.JavaScript.valueToCode(block, "v_x", Blockly.JavaScript.ORDER_ATOMIC);
          var value_y = Blockly.JavaScript.valueToCode(block, "v_y", Blockly.JavaScript.ORDER_ATOMIC);
          var value_z = Blockly.JavaScript.valueToCode(block, "v_z", Blockly.JavaScript.ORDER_ATOMIC);
          var value_a = Blockly.JavaScript.valueToCode(block, "v_a", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "fill(" + value_x + "," + value_y + "," + value_z + "," + value_a + ");\n";
          return code
      };
      Blockly.JavaScript["yak_color_noFill"] = function (block) {
          var code = "noFill(" + ");\n";
          return code
      };
      Blockly.JavaScript["yak_color_noStroke"] = function (block) {
          var code = "noStroke(" + ");\n";
          return code
      };
      Blockly.JavaScript["yak_color_stroke"] = function (block) {
          var value_stroke = Blockly.JavaScript.valueToCode(block, "v_stroke", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "stroke(" + value_stroke + ");\n";
          return code
      };
      Blockly.JavaScript["yak_color_stroke3"] = function (block) {
          var value_x = Blockly.JavaScript.valueToCode(block, "v_x", Blockly.JavaScript.ORDER_ATOMIC);
          var value_y = Blockly.JavaScript.valueToCode(block, "v_y", Blockly.JavaScript.ORDER_ATOMIC);
          var value_z = Blockly.JavaScript.valueToCode(block, "v_z", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "stroke(" + value_x + "," + value_y + "," + value_z + ");\n";
          return code
      };
      Blockly.JavaScript["yak_color_stroke4"] = function (block) {
          var value_x = Blockly.JavaScript.valueToCode(block, "v_x", Blockly.JavaScript.ORDER_ATOMIC);
          var value_y = Blockly.JavaScript.valueToCode(block, "v_y", Blockly.JavaScript.ORDER_ATOMIC);
          var value_z = Blockly.JavaScript.valueToCode(block, "v_z", Blockly.JavaScript.ORDER_ATOMIC);
          var value_w = Blockly.JavaScript.valueToCode(block, "v_w", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "stroke(" + value_x + "," + value_y + "," + value_z + "," + value_w + ");\n";
          return code
      };
      Blockly.JavaScript["yak_math_createVector"] = function (block) {
          var value_position_x = Blockly.JavaScript.valueToCode(block, "position_x", Blockly.JavaScript.ORDER_ATOMIC);
          var value_position_y = Blockly.JavaScript.valueToCode(block, "position_y", Blockly.JavaScript.ORDER_ATOMIC);
          var value_width = Blockly.JavaScript.valueToCode(block, "width", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "createVector(" + value_position_x + "," + value_position_y + "," + value_width + ");\n";
          return code
      };
      Blockly.JavaScript["yak_IO_save"] = function (block) {
          var value_v_x = Blockly.JavaScript.valueToCode(block, "v_x", Blockly.JavaScript.ORDER_ATOMIC);
          var value_v_y = Blockly.JavaScript.valueToCode(block, "v_y", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "save(" + value_v_x + "," + value_v_y + ");\n";
          return code
      };
      Blockly.JavaScript["yak_IO_saveJSON"] = function (block) {
          var value_v_x = Blockly.JavaScript.valueToCode(block, "v_x", Blockly.JavaScript.ORDER_ATOMIC);
          var value_v_y = Blockly.JavaScript.valueToCode(block, "v_y", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "saveJSON(" + value_v_x + "," + value_v_y + ");\n";
          return code
      };
      Blockly.JavaScript["yak_IO_saveStrings"] = function (block) {
          var value_v_x = Blockly.JavaScript.valueToCode(block, "v_x", Blockly.JavaScript.ORDER_ATOMIC);
          var value_v_y = Blockly.JavaScript.valueToCode(block, "v_y", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "saveStrings(" + value_v_x + "," + value_v_y + ");\n";
          return code
      };
      Blockly.JavaScript["yak_IO_saveTable"] = function (block) {
          var value_v_x = Blockly.JavaScript.valueToCode(block, "v_x", Blockly.JavaScript.ORDER_ATOMIC);
          var value_v_y = Blockly.JavaScript.valueToCode(block, "v_y", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "saveTable(" + value_v_x + "," + value_v_y + ");\n";
          return code
      };
      Blockly.JavaScript["yak_IO_loadFont"] = function (block) {
          var value_loadFont = Blockly.JavaScript.valueToCode(block, "v_loadFont", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "loadFont(" + value_loadFont + ");\n";
          return code
      };
      Blockly.JavaScript["yak_IO_loadJSON"] = function (block) {
          var value_loadJSON = Blockly.JavaScript.valueToCode(block, "v_loadJSON", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "loadJSON(" + value_loadJSON + ");\n";
          return code
      };
      Blockly.JavaScript["yak_IO_loadStrings"] = function (block) {
          var value_loadStrings = Blockly.JavaScript.valueToCode(block, "v_loadStrings", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "loadStrings(" + value_loadStrings + ");\n";
          return code
      };
      Blockly.JavaScript["yak_IO_loadTable"] = function (block) {
          var value_loadTable = Blockly.JavaScript.valueToCode(block, "v_loadTable", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "loadTable(" + value_loadTable + ");\n";
          return code
      };
      Blockly.JavaScript["yak_IO_loadXML"] = function (block) {
          var value_loadXML = Blockly.JavaScript.valueToCode(block, "v_loadXML", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "loadXML(" + value_loadXML + ");\n";
          return code
      };
      Blockly.JavaScript["yak_IO_httpGet"] = function (block) {
          var value_httpGet = Blockly.JavaScript.valueToCode(block, "v_httpGet", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "httpGet(" + value_httpGet + ");\n";
          return code
      };
      Blockly.JavaScript["yak_IO_httpPost"] = function (block) {
          var value_httpGet = Blockly.JavaScript.valueToCode(block, "v_httpPost", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "httpPost(" + value_httpPost + ");\n";
          return code
      };
      Blockly.JavaScript["yak_IO_httpDo"] = function (block) {
          var value_httpDo = Blockly.JavaScript.valueToCode(block, "v_httpDo", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "httpDo(" + value_httpDo + ");\n";
          return code
      };
      Blockly.JavaScript["yak_IO_day"] = function (block) {
          var code = "day(" + ");\n";
          return code
      };
      Blockly.JavaScript["yak_IO_hour"] = function (block) {
          var code = "hour(" + ");\n";
          return code
      };
      Blockly.JavaScript["yak_IO_minute"] = function (block) {
          var code = "minute(" + ");\n";
          return code
      };
      Blockly.JavaScript["yak_IO_millis"] = function (block) {
          var code = "millis(" + ")";
          return [code, Blockly.JavaScript.ORDER_ATOMIC]
      };
      Blockly.JavaScript["yak_IO_month"] = function (block) {
          var code = "month(" + ");\n";
          return code
      };
      Blockly.JavaScript["yak_IO_second"] = function (block) {
          var code = "second(" + ");\n";
          return code
      };
      Blockly.JavaScript["yak_IO_year"] = function (block) {
          var code = "year(" + ");\n";
          return code
      };
      Blockly.JavaScript["yak_image_blend"] = function (block) {
          var value_position_x = Blockly.JavaScript.valueToCode(block, "position_x", Blockly.JavaScript.ORDER_ATOMIC);
          var value_position_y = Blockly.JavaScript.valueToCode(block, "position_y", Blockly.JavaScript.ORDER_ATOMIC);
          var value_width = Blockly.JavaScript.valueToCode(block, "width", Blockly.JavaScript.ORDER_ATOMIC);
          var value_height = Blockly.JavaScript.valueToCode(block, "height", Blockly.JavaScript.ORDER_ATOMIC);
          var value_v_x = Blockly.JavaScript.valueToCode(block, "v_x", Blockly.JavaScript.ORDER_ATOMIC);
          var value_v_y = Blockly.JavaScript.valueToCode(block, "v_y", Blockly.JavaScript.ORDER_ATOMIC);
          var value_v_z = Blockly.JavaScript.valueToCode(block, "v_z", Blockly.JavaScript.ORDER_ATOMIC);
          var value_v_w = Blockly.JavaScript.valueToCode(block, "v_w", Blockly.JavaScript.ORDER_ATOMIC);
          var value_v_dh = Blockly.JavaScript.valueToCode(block, "v_dh", Blockly.JavaScript.ORDER_ATOMIC);
          var dropdown_name = block.getFieldValue("NAME");
          var code = "blend(" + value_position_x + "," + value_position_y + "," + value_width + ", " + value_height + "," + value_v_x + "," + value_v_y + "," + value_v_z + "," + value_v_w + "," + value_v_dh + "," + dropdown_name + ");\n";
          return code
      };
      Blockly.JavaScript["yak_image_copy"] = function (block) {
          var value_position_x = Blockly.JavaScript.valueToCode(block, "position_x", Blockly.JavaScript.ORDER_ATOMIC);
          var value_position_y = Blockly.JavaScript.valueToCode(block, "position_y", Blockly.JavaScript.ORDER_ATOMIC);
          var value_width = Blockly.JavaScript.valueToCode(block, "width", Blockly.JavaScript.ORDER_ATOMIC);
          var value_height = Blockly.JavaScript.valueToCode(block, "height", Blockly.JavaScript.ORDER_ATOMIC);
          var value_v_x = Blockly.JavaScript.valueToCode(block, "v_x", Blockly.JavaScript.ORDER_ATOMIC);
          var value_v_y = Blockly.JavaScript.valueToCode(block, "v_y", Blockly.JavaScript.ORDER_ATOMIC);
          var value_v_z = Blockly.JavaScript.valueToCode(block, "v_z", Blockly.JavaScript.ORDER_ATOMIC);
          var value_v_w = Blockly.JavaScript.valueToCode(block, "v_w", Blockly.JavaScript.ORDER_ATOMIC);
          var value_v_dh = Blockly.JavaScript.valueToCode(block, "v_dh", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "copy(" + value_position_x + "," + value_position_y + "," + value_width + ", " + value_height + "," + value_v_x + "," + value_v_y + "," + value_v_z + "," + value_v_w + "," + value_v_dh + ");\n";
          return code
      };
      Blockly.JavaScript["yak_image_filter"] = function (block) {
          var dropdown_name = block.getFieldValue("NAME");
          var code = "filter(" + dropdown_name + ");\n";
          return code
      };
      Blockly.JavaScript["yak_image_get"] = function (block) {
          var value_x = Blockly.JavaScript.valueToCode(block, "x", Blockly.JavaScript.ORDER_ATOMIC);
          var value_y = Blockly.JavaScript.valueToCode(block, "y", Blockly.JavaScript.ORDER_ATOMIC);
          var value_width = Blockly.JavaScript.valueToCode(block, "width", Blockly.JavaScript.ORDER_ATOMIC);
          var value_height = Blockly.JavaScript.valueToCode(block, "height", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "get(" + value_x + "," + value_y + "," + value_width + ", " + value_height + ");\n";
          return code
      };
      Blockly.JavaScript["yak_image_loadPixels"] = function (block) {
          var code = "loadPixels(" + ");\n";
          return code
      };
      Blockly.JavaScript["yak_image_set"] = function (block) {
          var value_x = Blockly.JavaScript.valueToCode(block, "x", Blockly.JavaScript.ORDER_ATOMIC);
          var value_y = Blockly.JavaScript.valueToCode(block, "y", Blockly.JavaScript.ORDER_ATOMIC);
          var value_width = Blockly.JavaScript.valueToCode(block, "width", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "set(" + value_x + "," + value_y + "," + value_width + ");\n";
          return code
      };
      Blockly.JavaScript["yak_image_updatePixels"] = function (block) {
          var code = "updatePixels(" + ");\n";
          return code
      };
      Blockly.JavaScript["yak_image_loadImage"] = function (block) {
          var value_strokeWeight = Blockly.JavaScript.valueToCode(block, "v_loadImage", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "loadImage(" + value_strokeWeight + ")";
          return [code, Blockly.JavaScript.ORDER_ATOMIC]
      };
      Blockly.JavaScript["yak_image_tint"] = function (block) {
          var value_position_x = Blockly.JavaScript.valueToCode(block, "position_x", Blockly.JavaScript.ORDER_ATOMIC);
          var value_position_y = Blockly.JavaScript.valueToCode(block, "position_y", Blockly.JavaScript.ORDER_ATOMIC);
          var value_width = Blockly.JavaScript.valueToCode(block, "width", Blockly.JavaScript.ORDER_ATOMIC);
          var value_height = Blockly.JavaScript.valueToCode(block, "height", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "tint(" + value_position_x + "," + value_position_y + "," + value_width + ", " + value_height + ");\n";
          return code
      };
      Blockly.JavaScript["yak_image_noTint"] = function (block) {
          var code = "noTint(" + ");\n";
          return code
      };
      Blockly.JavaScript["yak_image_imageMode"] = function (block) {
          var dropdown_name = block.getFieldValue("NAME");
          var code = "imageMode(" + dropdown_name + ");\n";
          return code
      };
      Blockly.JavaScript["yak_image_createImage"] = function (block) {
          var value_width = Blockly.JavaScript.valueToCode(block, "v_width", Blockly.JavaScript.ORDER_ATOMIC);
          var value_height = Blockly.JavaScript.valueToCode(block, "v_height", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "createImage(" + value_width + ", " + value_height + ");\n";
          return code
      };
      Blockly.JavaScript["yak_image_saveCanvas"] = function (block) {
          var value_position_x = Blockly.JavaScript.valueToCode(block, "position_x", Blockly.JavaScript.ORDER_ATOMIC);
          var value_position_y = Blockly.JavaScript.valueToCode(block, "position_y", Blockly.JavaScript.ORDER_ATOMIC);
          var value_width = Blockly.JavaScript.valueToCode(block, "width", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "saveCanvas(" + value_position_x + "," + value_position_y + "," + value_width + ");\n";
          return code
      };
      Blockly.JavaScript["yak_image_saveFrames"] = function (block) {
          var value_position_x = Blockly.JavaScript.valueToCode(block, "position_x", Blockly.JavaScript.ORDER_ATOMIC);
          var value_position_y = Blockly.JavaScript.valueToCode(block, "position_y", Blockly.JavaScript.ORDER_ATOMIC);
          var value_width = Blockly.JavaScript.valueToCode(block, "width", Blockly.JavaScript.ORDER_ATOMIC);
          var value_height = Blockly.JavaScript.valueToCode(block, "height", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "saveFrames(" + value_position_x + "," + value_position_y + "," + value_width + ", " + value_height + ");\n";
          return code
      };
      Blockly.JavaScript["yak_draw_heart"] = function (block) {
          var code = "function heart(a) {\n" + "var big = ((frameCount + a + 0.01) % beat) / beat;\n" + "var start = color(255);\n" + "var end = color(237, 87, 76, 60);\n" + "scale(big);\n" + "for (var i = 0; i < 360; i++) {\n" + "var x = 16 * pow(sin(radians(i)), 3);\n" + "var y = 13 * cos(radians(i)) - 5 * cos((distance - 1)  * radians(i)) - 2 * cos(distance * radians(i)) - cos((distance + 1) * radians(i));\n" + "fill(lerpColor(start, end, big));\n" + "ellipse(x*10, -y*10, 6, 6);\n" + "}\n" + "scale(1 / big);\n" + "};\n";
          return code
      };
      Blockly.JavaScript["yak_event_touchStarted"] = function (block) {
          var value_draw = Blockly.JavaScript.statementToCode(block, "DO", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "touchStarted=function(){\n" + value_draw + "};\n";
          return code
      };
      Blockly.JavaScript["yak_event_touchMoved"] = function (block) {
          var value_draw = Blockly.JavaScript.statementToCode(block, "DO", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "touchMoved=function(){\n" + value_draw + "};\n";
          return code
      };
      Blockly.JavaScript["yak_event_touchEnded"] = function (block) {
          var value_draw = Blockly.JavaScript.statementToCode(block, "DO", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "touchEnded=function(){\n" + value_draw + "};\n";
          return code
      };
      Blockly.JavaScript["yak_event_mouse_constants"] = function (block) {
          var dropdown_name = block.getFieldValue("NAME");
          var code = dropdown_name;
          return [code, Blockly.JavaScript.ORDER_ATOMIC]
      };
      Blockly.JavaScript["yak_event_mouseMoved"] = function (block) {
          var value_draw = Blockly.JavaScript.statementToCode(block, "DO", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "mouseMoved=function(){\n" + value_draw + "};\n";
          return code
      };
      Blockly.JavaScript["yak_event_mouseDragged"] = function (block) {
          var value_draw = Blockly.JavaScript.statementToCode(block, "DO", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "mouseDragged=function(){\n" + value_draw + "};\n";
          return code
      };
      Blockly.JavaScript["yak_event_mousePressed"] = function (block) {
          var value_draw = Blockly.JavaScript.statementToCode(block, "DO", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "mousePressed=function(){\n" + value_draw + "};\n";
          return code
      };
      Blockly.JavaScript["yak_event_mouseReleased"] = function (block) {
          var value_draw = Blockly.JavaScript.statementToCode(block, "DO", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "mouseReleased=function(){\n" + value_draw + "};\n";
          return code
      };
      Blockly.JavaScript["yak_event_mouseClicked"] = function (block) {
          var value_draw = Blockly.JavaScript.statementToCode(block, "DO", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "mouseClicked=function(){\n" + value_draw + "};\n";
          return code
      };
      Blockly.JavaScript["yak_event_mouseWheel"] = function (block) {
          var value_draw = Blockly.JavaScript.statementToCode(block, "DO", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "mouseWheel=function(){\n" + value_draw + "};\n";
          return code
      };
      Blockly.JavaScript["yak_color_alpha"] = function (block) {
          var value_alpha = Blockly.JavaScript.valueToCode(block, "v_alpha", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "alpha(" + value_alpha + ");\n";
          return code
      };
      Blockly.JavaScript["yak_color_blue"] = function (block) {
          var value_blue = Blockly.JavaScript.valueToCode(block, "v_blue", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "blue(" + value_blue + ");\n";
          return code
      };
      Blockly.JavaScript["yak_color_brightness"] = function (block) {
          var value_brightness = Blockly.JavaScript.valueToCode(block, "v_brightness", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "brightness(" + value_brightness + ");\n";
          return code
      };
      Blockly.JavaScript["yak_color_color_gray"] = function (block) {
          var value_color = Blockly.JavaScript.valueToCode(block, "v_color", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "color(" + "'" + value_color + "'" + ");\n";
          return code
      };
      Blockly.JavaScript["yak_color_color"] = function (block) {
          var value_v_x = Blockly.JavaScript.valueToCode(block, "v_x", Blockly.JavaScript.ORDER_ATOMIC);
          var value_v_y = Blockly.JavaScript.valueToCode(block, "v_y", Blockly.JavaScript.ORDER_ATOMIC);
          var value_v_z = Blockly.JavaScript.valueToCode(block, "v_z", Blockly.JavaScript.ORDER_ATOMIC);
          var value_v_w = Blockly.JavaScript.valueToCode(block, "v_w", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "color(" + value_v_x + "," + value_v_y + "," + value_v_z + "," + value_v_w + ")";
          return [code, Blockly.JavaScript.ORDER_ATOMIC]
      };
      Blockly.JavaScript["yak_color_color3"] = function (block) {
          var value_v_x = Blockly.JavaScript.valueToCode(block, "v_x", Blockly.JavaScript.ORDER_ATOMIC);
          var value_v_y = Blockly.JavaScript.valueToCode(block, "v_y", Blockly.JavaScript.ORDER_ATOMIC);
          var value_v_z = Blockly.JavaScript.valueToCode(block, "v_z", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "color(" + value_v_x + "," + value_v_y + "," + value_v_z + ")";
          return [code, Blockly.JavaScript.ORDER_ATOMIC]
      };
      Blockly.JavaScript["yak_color_green"] = function (block) {
          var value_green = Blockly.JavaScript.valueToCode(block, "v_green", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "green(" + value_green + ");\n";
          return [code, Blockly.JavaScript.ORDER_ATOMIC]
      };
      Blockly.JavaScript["yak_color_hue"] = function (block) {
          var value_hue = Blockly.JavaScript.valueToCode(block, "v_hue", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "hue(" + value_hue + ");\n";
          return [code, Blockly.JavaScript.ORDER_ATOMIC]
      };
      Blockly.JavaScript["yak_color_lerpColor"] = function (block) {
          var value_v_x = Blockly.JavaScript.valueToCode(block, "v_x", Blockly.JavaScript.ORDER_ATOMIC);
          var value_v_y = Blockly.JavaScript.valueToCode(block, "v_y", Blockly.JavaScript.ORDER_ATOMIC);
          var value_v_z = Blockly.JavaScript.valueToCode(block, "v_z", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "lerpColor(" + value_v_x + "," + value_v_y + "," + value_v_z + ");\n";
          return [code, Blockly.JavaScript.ORDER_ATOMIC]
      };
      Blockly.JavaScript["yak_color_lightness"] = function (block) {
          var value_lightness = Blockly.JavaScript.valueToCode(block, "v_lightness", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "lightness(" + value_lightness + ");\n";
          return code
      };
      Blockly.JavaScript["yak_color_red"] = function (block) {
          var value_red = Blockly.JavaScript.valueToCode(block, "v_red", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "red(" + value_red + ");\n";
          return code
      };
      Blockly.JavaScript["yak_color_saturation"] = function (block) {
          var value_saturation = Blockly.JavaScript.valueToCode(block, "v_saturation", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "saturation(" + value_saturation + ");\n";
          return code
      };
      Blockly.JavaScript['yak_function_drawGrid'] = function (block) {
          // TODO: Assemble JavaScript into code variable.
          var code = 'function drawGrid() { \n' +
              'stroke(200);\n' +
              'fill(120);\n' +
              'for (var x=-width; x < width; x+=40) {\n' +
              'line(x, -height, x, height);\n' +
              'text(x, x+1, 12);\n' +
              '}\n' +
              'for (var y=-height; y < height; y+=40) {\n' +
              'line(-width, y, width, y);\n' +
              'text(y, 1, y+12);\n' +
              '}\n' +
              '};\n';
          return code;
      };
      Blockly.JavaScript['yak_drawGrid'] = function (block) {
          // TODO: Assemble JavaScript into code variable.
          var code = 'drawGrid();\n';
          return code;
      };
      Blockly.JavaScript['graph_set_increase'] = function (block) {
          // a variable setter.
          var argument0 = Blockly.JavaScript.valueToCode(block, 'VALUE',
              Blockly.JavaScript.ORDER_ASSIGNMENT) || '';
          return 'increase = ' + argument0 + ';\n';
      };
      Blockly.JavaScript['graph_get_increase'] = function (block) {
          // a variable getter.
          return ['increase', Blockly.JavaScript.ORDER_ATOMIC];
      };
      Blockly.JavaScript['yak_function_heart'] = function (block) {
          // TODO: Assemble JavaScript into code variable.
          var code = 'function heart() { \n' +
              'for (var angle = -90; angle < 90; angle += 0.5) {\n' +
              'for (var q = 1; q < 2; q += 0.2) {\n' +
              'var a = q*180;\n' +
              'var t = angle+frameCount*1.5+a;\n' +
              'var x = 16*pow(sin(radians(t)), 3);\n' +
              'var y = -13*cos(radians(t)) + 5*cos(radians(2*t)) + 2*cos(radians(3*t)) + cos(radians(4*t));\n' +
              'var s = cos(radians(angle))*q*7;\n' +
              'ellipse(x*q*8, y*q*8, s, s);\n' +
              '}\n' +
              '}\n' +
              '}\n';
          return code;
      };
      Blockly.JavaScript['yak_heart'] = function (block) {
          // TODO: Assemble JavaScript into code variable.
          var code = 'heart();\n';
          return code;
      };
      Blockly.JavaScript['yak_heart'] = function (block) {
          // TODO: Assemble JavaScript into code variable.
          var code = 'heart();\n';
          return code;
      };
      Blockly.JavaScript['yak_typography_text3'] = function (block) {
          var value_position_x = Blockly.JavaScript.valueToCode(block, 'position_x', Blockly.JavaScript.ORDER_ATOMIC);
          var value_position_y = Blockly.JavaScript.valueToCode(block, 'position_y', Blockly.JavaScript.ORDER_ATOMIC);
          var value_width = Blockly.JavaScript.valueToCode(block, 'width', Blockly.JavaScript.ORDER_ATOMIC);
  
          var code = 'text(' + value_position_x + ',' + value_position_y + ',' + value_width + ');\n';
          return code;
      };
      Blockly.JavaScript['graph_set_margin'] = function (block) {
          // a variable setter.
          var argument0 = Blockly.JavaScript.valueToCode(block, 'VALUE',
              Blockly.JavaScript.ORDER_ASSIGNMENT) || '';
          return 'margin = ' + argument0 + ';\n';
      };
      Blockly.JavaScript['graph_get_margin'] = function (block) {
          // a variable getter.
          return ['margin', Blockly.JavaScript.ORDER_ATOMIC];
      };
      Blockly.JavaScript['graph_set_num'] = function (block) {
          // a variable setter.
          var argument0 = Blockly.JavaScript.valueToCode(block, 'VALUE',
              Blockly.JavaScript.ORDER_ASSIGNMENT) || '';
          return 'num = ' + argument0 + ';\n';
      };
      Blockly.JavaScript['graph_get_num'] = function (block) {
          // a variable getter.
          return ['num', Blockly.JavaScript.ORDER_ATOMIC];
      };
      Blockly.JavaScript['graph_set_rad'] = function (block) {
          // a variable setter.
          var argument0 = Blockly.JavaScript.valueToCode(block, 'VALUE',
              Blockly.JavaScript.ORDER_ASSIGNMENT) || '';
          return 'rad = ' + argument0 + ';\n';
      };
  
      Blockly.JavaScript['graph_get_rad'] = function (block) {
          // a variable getter.
          return ['rad', Blockly.JavaScript.ORDER_ATOMIC];
      };
      Blockly.JavaScript["yak_image_filter"] = function (block) {
          var dropdown_name = block.getFieldValue("NAME");
          var code = "filter(" + dropdown_name + ");\n";
          return code
      };
      Blockly.JavaScript["yak_math_ceil"] = function (block) {
          var value_ceil = Blockly.JavaScript.valueToCode(block, "v_ceil", Blockly.JavaScript.ORDER_ATOMIC);
          var code = "ceil(" + value_ceil + ");\n";
          return code
      };
      Blockly.JavaScript['yak_transform_translate3'] = function (block) {
          var value_v_x = Blockly.JavaScript.valueToCode(block, 'v_x', Blockly.JavaScript.ORDER_ATOMIC);
          var value_v_y = Blockly.JavaScript.valueToCode(block, 'v_y', Blockly.JavaScript.ORDER_ATOMIC);
          var value_v_z = Blockly.JavaScript.valueToCode(block, 'v_z', Blockly.JavaScript.ORDER_ATOMIC);
          // TODO: Assemble JavaScript into code variable.
          var code = 'translate(' + value_v_x + ',' + value_v_y + ',' + value_v_z + ');\n';
          return code;
      };
      Blockly.JavaScript['yak_math_createVector2'] = function (block) {
          var value_width = Blockly.JavaScript.valueToCode(block, 'v_width', Blockly.JavaScript.ORDER_ATOMIC);
          var value_height = Blockly.JavaScript.valueToCode(block, 'v_height', Blockly.JavaScript.ORDER_ATOMIC);
          var code = 'createVector(' + value_width + ', ' + value_height + ')';
          return [code, Blockly.JavaScript.ORDER_ATOMIC];
      };
      Blockly.JavaScript['yak_image_image'] = function (block) {
          var value_width = Blockly.JavaScript.valueToCode(block, 'v_width', Blockly.JavaScript.ORDER_ATOMIC);
          var value_height = Blockly.JavaScript.valueToCode(block, 'v_height', Blockly.JavaScript.ORDER_ATOMIC);
          var value_z = Blockly.JavaScript.valueToCode(block, 'v_z', Blockly.JavaScript.ORDER_ATOMIC);
          var code = 'image(' + value_width + ', ' + value_height + ', ' + value_z + ');\n';
          return code;
      };
      return Blockly.JavaScript;
  }