From 3f99eca6781641a3447a9e612681ae829e0608ac Mon Sep 17 00:00:00 2001 From: nionata Date: Thu, 21 May 2020 12:52:49 -0400 Subject: [PATCH] public/frontend --- cms/public/frontend/asset-manifest.json | 23 + cms/public/frontend/favicon.ico | Bin 0 -> 3150 bytes cms/public/frontend/index.html | 1 + cms/public/frontend/lib/arduino_compressed.js | 105 ++ cms/public/frontend/lib/blockly_compressed.js | 1481 +++++++++++++++++ cms/public/frontend/lib/blocks_compressed.js | 208 +++ cms/public/frontend/lib/en.js | 512 ++++++ .../frontend/lib/javascript_compressed.js | 84 + cms/public/frontend/logo192.png | Bin 0 -> 5347 bytes cms/public/frontend/logo512.png | Bin 0 -> 9664 bytes cms/public/frontend/manifest.json | 25 + ...nifest.c70e237f73f5412c548ea2bfa8ff3251.js | 30 + cms/public/frontend/robots.txt | 3 + cms/public/frontend/service-worker.js | 39 + .../static/css/main.213136e4.chunk.css | 2 + .../static/css/main.213136e4.chunk.css.map | 1 + .../frontend/static/js/2.d1f82d42.chunk.js | 3 + .../static/js/2.d1f82d42.chunk.js.LICENSE.txt | 41 + .../static/js/2.d1f82d42.chunk.js.map | 1 + .../frontend/static/js/main.8c1be84d.chunk.js | 3 + .../js/main.8c1be84d.chunk.js.LICENSE.txt | 14 + .../static/js/main.8c1be84d.chunk.js.map | 1 + .../static/js/runtime-main.73c9ea4d.js | 2 + .../static/js/runtime-main.73c9ea4d.js.map | 1 + 24 files changed, 2580 insertions(+) create mode 100644 cms/public/frontend/asset-manifest.json create mode 100644 cms/public/frontend/favicon.ico create mode 100644 cms/public/frontend/index.html create mode 100644 cms/public/frontend/lib/arduino_compressed.js create mode 100644 cms/public/frontend/lib/blockly_compressed.js create mode 100644 cms/public/frontend/lib/blocks_compressed.js create mode 100644 cms/public/frontend/lib/en.js create mode 100644 cms/public/frontend/lib/javascript_compressed.js create mode 100644 cms/public/frontend/logo192.png create mode 100644 cms/public/frontend/logo512.png create mode 100644 cms/public/frontend/manifest.json create mode 100644 cms/public/frontend/precache-manifest.c70e237f73f5412c548ea2bfa8ff3251.js create mode 100644 cms/public/frontend/robots.txt create mode 100644 cms/public/frontend/service-worker.js create mode 100644 cms/public/frontend/static/css/main.213136e4.chunk.css create mode 100644 cms/public/frontend/static/css/main.213136e4.chunk.css.map create mode 100644 cms/public/frontend/static/js/2.d1f82d42.chunk.js create mode 100644 cms/public/frontend/static/js/2.d1f82d42.chunk.js.LICENSE.txt create mode 100644 cms/public/frontend/static/js/2.d1f82d42.chunk.js.map create mode 100644 cms/public/frontend/static/js/main.8c1be84d.chunk.js create mode 100644 cms/public/frontend/static/js/main.8c1be84d.chunk.js.LICENSE.txt create mode 100644 cms/public/frontend/static/js/main.8c1be84d.chunk.js.map create mode 100644 cms/public/frontend/static/js/runtime-main.73c9ea4d.js create mode 100644 cms/public/frontend/static/js/runtime-main.73c9ea4d.js.map diff --git a/cms/public/frontend/asset-manifest.json b/cms/public/frontend/asset-manifest.json new file mode 100644 index 00000000..679ff07f --- /dev/null +++ b/cms/public/frontend/asset-manifest.json @@ -0,0 +1,23 @@ +{ + "files": { + "main.css": "/frontend/static/css/main.213136e4.chunk.css", + "main.js": "/frontend/static/js/main.8c1be84d.chunk.js", + "main.js.map": "/frontend/static/js/main.8c1be84d.chunk.js.map", + "runtime-main.js": "/frontend/static/js/runtime-main.73c9ea4d.js", + "runtime-main.js.map": "/frontend/static/js/runtime-main.73c9ea4d.js.map", + "static/js/2.d1f82d42.chunk.js": "/frontend/static/js/2.d1f82d42.chunk.js", + "static/js/2.d1f82d42.chunk.js.map": "/frontend/static/js/2.d1f82d42.chunk.js.map", + "index.html": "/frontend/index.html", + "precache-manifest.c70e237f73f5412c548ea2bfa8ff3251.js": "/frontend/precache-manifest.c70e237f73f5412c548ea2bfa8ff3251.js", + "service-worker.js": "/frontend/service-worker.js", + "static/css/main.213136e4.chunk.css.map": "/frontend/static/css/main.213136e4.chunk.css.map", + "static/js/2.d1f82d42.chunk.js.LICENSE.txt": "/frontend/static/js/2.d1f82d42.chunk.js.LICENSE.txt", + "static/js/main.8c1be84d.chunk.js.LICENSE.txt": "/frontend/static/js/main.8c1be84d.chunk.js.LICENSE.txt" + }, + "entrypoints": [ + "static/js/runtime-main.73c9ea4d.js", + "static/js/2.d1f82d42.chunk.js", + "static/css/main.213136e4.chunk.css", + "static/js/main.8c1be84d.chunk.js" + ] +} \ No newline at end of file diff --git a/cms/public/frontend/favicon.ico b/cms/public/frontend/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..bcd5dfd67cd0361b78123e95c2dd96031f27f743 GIT binary patch literal 3150 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 MDeX2GIKR{Qf5okjU;qFB literal 0 HcmV?d00001 diff --git a/cms/public/frontend/index.html b/cms/public/frontend/index.html new file mode 100644 index 00000000..8f642435 --- /dev/null +++ b/cms/public/frontend/index.html @@ -0,0 +1 @@ +STEM+C
\ No newline at end of file diff --git a/cms/public/frontend/lib/arduino_compressed.js b/cms/public/frontend/lib/arduino_compressed.js new file mode 100644 index 00000000..5a5088a4 --- /dev/null +++ b/cms/public/frontend/lib/arduino_compressed.js @@ -0,0 +1,105 @@ +// Do not edit this file; automatically generated by build.py. +'use strict'; + +/* + Licensed under the Apache License, Version 2.0 (the "License"): + http://www.apache.org/licenses/LICENSE-2.0 +*/ +Blockly.Arduino=new Blockly.Generator("Arduino");Blockly.Arduino.StaticTyping=new Blockly.StaticTyping;Blockly.Arduino.addReservedWords("Blockly,setup,loop,if,else,for,switch,case,while,do,break,continue,return,goto,define,include,HIGH,LOW,INPUT,OUTPUT,INPUT_PULLUP,true,false,integer,constants,floating,point,void,boolean,char,unsigned,byte,int,word,long,float,double,string,String,array,static,volatile,const,sizeof,pinMode,digitalWrite,digitalRead,analogReference,analogRead,analogWrite,tone,noTone,shiftOut,shitIn,pulseIn,millis,micros,delay,delayMicroseconds,min,max,abs,constrain,map,pow,sqrt,sin,cos,tan,randomSeed,random,lowByte,highByte,bitRead,bitWrite,bitSet,bitClear,bit,attachInterrupt,detachInterrupt,interrupts,noInterrupts"); +Blockly.Arduino.ORDER_ATOMIC=0;Blockly.Arduino.ORDER_UNARY_POSTFIX=1;Blockly.Arduino.ORDER_UNARY_PREFIX=2;Blockly.Arduino.ORDER_MULTIPLICATIVE=3;Blockly.Arduino.ORDER_ADDITIVE=4;Blockly.Arduino.ORDER_SHIFT=5;Blockly.Arduino.ORDER_RELATIONAL=6;Blockly.Arduino.ORDER_EQUALITY=7;Blockly.Arduino.ORDER_BITWISE_AND=8;Blockly.Arduino.ORDER_BITWISE_XOR=9;Blockly.Arduino.ORDER_BITWISE_OR=10;Blockly.Arduino.ORDER_LOGICAL_AND=11;Blockly.Arduino.ORDER_LOGICAL_OR=12;Blockly.Arduino.ORDER_CONDITIONAL=13; +Blockly.Arduino.ORDER_ASSIGNMENT=14;Blockly.Arduino.ORDER_NONE=99;Blockly.Arduino.PinTypes={INPUT:"INPUT",OUTPUT:"OUTPUT",PWM:"PWM",SERVO:"SERVO",STEPPER:"STEPPER",SERIAL:"SERIAL",I2C:"I2C/TWI",SPI:"SPI"};Blockly.Arduino.DEF_FUNC_NAME=Blockly.Arduino.FUNCTION_NAME_PLACEHOLDER_; +Blockly.Arduino.init=function(a){Blockly.Arduino.includes_=Object.create(null);Blockly.Arduino.definitions_=Object.create(null);Blockly.Arduino.variables_=Object.create(null);Blockly.Arduino.codeFunctions_=Object.create(null);Blockly.Arduino.userFunctions_=Object.create(null);Blockly.Arduino.functionNames_=Object.create(null);Blockly.Arduino.setups_=Object.create(null);Blockly.Arduino.pins_=Object.create(null);Blockly.Arduino.variableDB_?Blockly.Arduino.variableDB_.reset():Blockly.Arduino.variableDB_= +new Blockly.Names(Blockly.Arduino.RESERVED_WORDS_);var b=Blockly.Arduino.StaticTyping.collectVarsWithTypes(a);Blockly.Arduino.StaticTyping.setProcedureArgs(a,b);for(var c in b)Blockly.Arduino.addVariable(c,Blockly.Arduino.getArduinoType_(b[c])+" "+Blockly.Arduino.variableDB_.getName(c,Blockly.Variables.NAME_TYPE)+";")}; +Blockly.Arduino.finish=function(a){var b=[],c=[],d=[],e=[],f;for(f in Blockly.Arduino.includes_)b.push(Blockly.Arduino.includes_[f]);b.length&&b.push("\n");for(f in Blockly.Arduino.variables_)d.push(Blockly.Arduino.variables_[f]);d.length&&d.push("\n");for(f in Blockly.Arduino.definitions_)c.push(Blockly.Arduino.definitions_[f]);c.length&&c.push("\n");for(f in Blockly.Arduino.codeFunctions_)e.push(Blockly.Arduino.codeFunctions_[f]);for(f in Blockly.Arduino.userFunctions_)e.push(Blockly.Arduino.userFunctions_[f]); +e.length&&e.push("\n");var g=[""],h="";void 0!==Blockly.Arduino.setups_.userSetupCode&&(h="\n"+Blockly.Arduino.setups_.userSetupCode,delete Blockly.Arduino.setups_.userSetupCode);for(f in Blockly.Arduino.setups_)g.push(Blockly.Arduino.setups_[f]);h&&g.push(h);delete Blockly.Arduino.includes_;delete Blockly.Arduino.definitions_;delete Blockly.Arduino.codeFunctions_;delete Blockly.Arduino.userFunctions_;delete Blockly.Arduino.functionNames_;delete Blockly.Arduino.setups_;delete Blockly.Arduino.pins_; +Blockly.Arduino.variableDB_.reset();b=b.join("\n")+d.join("\n")+c.join("\n")+e.join("\n\n");g="void setup() {"+g.join("\n ")+"\n}\n\n";a="void loop() {\n "+a.replace(/\n/g,"\n ")+"\n}";return b+g+a};Blockly.Arduino.addInclude=function(a,b){void 0===Blockly.Arduino.includes_[a]&&(Blockly.Arduino.includes_[a]=b)};Blockly.Arduino.addDeclaration=function(a,b){void 0===Blockly.Arduino.definitions_[a]&&(Blockly.Arduino.definitions_[a]=b)}; +Blockly.Arduino.addVariable=function(a,b,c){var d=!1;if(c||void 0===Blockly.Arduino.variables_[a])Blockly.Arduino.variables_[a]=b,d=!0;return d};Blockly.Arduino.addSetup=function(a,b,c){var d=!1;if(c||void 0===Blockly.Arduino.setups_[a])Blockly.Arduino.setups_[a]=b,d=!0;return d}; +Blockly.Arduino.addFunction=function(a,b){if(void 0===Blockly.Arduino.codeFunctions_[a]){var c=Blockly.Arduino.variableDB_.getDistinctName(a,Blockly.Generator.NAME_TYPE);Blockly.Arduino.codeFunctions_[a]=b.replace(Blockly.Arduino.DEF_FUNC_NAME,c);Blockly.Arduino.functionNames_[a]=c}return Blockly.Arduino.functionNames_[a]}; +Blockly.Arduino.reservePin=function(a,b,c,d){void 0!==Blockly.Arduino.pins_[b]?Blockly.Arduino.pins_[b]!=c?a.setWarningText(Blockly.Msg.ARD_PIN_WARN1.replace("%1",b).replace("%2",d).replace("%3",c).replace("%4",Blockly.Arduino.pins_[b]),d):a.setWarningText(null,d):(Blockly.Arduino.pins_[b]=c,a.setWarningText(null,d))};Blockly.Arduino.scrubNakedValue=function(a){return a+";\n"}; +Blockly.Arduino.quote_=function(a){a=a.replace(/\\/g,"\\\\").replace(/\n/g,"\\\n").replace(/\$/g,"\\$").replace(/'/g,"\\'");return'"'+a+'"'}; +Blockly.Arduino.scrub_=function(a,b){if(null===b)return"";var c="";if(!a.outputConnection||!a.outputConnection.targetConnection){var d=a.getCommentText();d&&(c+=this.prefixLines(d,"// ")+"\n");for(var e=0;ec||255",GTE:">="}[a.getFieldValue("OP")],c="=="==b||"!="==b?Blockly.Arduino.ORDER_EQUALITY:Blockly.Arduino.ORDER_RELATIONAL,d=Blockly.Arduino.valueToCode(a,"A",c)||"0";a=Blockly.Arduino.valueToCode(a,"B",c)||"0";return[d+" "+b+" "+a,c]}; +Blockly.Arduino.logic_operation=function(a){var b="AND"==a.getFieldValue("OP")?"&&":"||",c="&&"==b?Blockly.Arduino.ORDER_LOGICAL_AND:Blockly.Arduino.ORDER_LOGICAL_OR,d=Blockly.Arduino.valueToCode(a,"A",c)||"false";a=Blockly.Arduino.valueToCode(a,"B",c)||"false";if(d||a){var e="&&"==b?"true":"false";d||(d=e);a||(a=e)}else a=d="false";return[d+" "+b+" "+a,c]}; +Blockly.Arduino.logic_negate=function(a){var b=Blockly.Arduino.ORDER_UNARY_PREFIX;return["!"+(Blockly.Arduino.valueToCode(a,"BOOL",b)||"false"),b]};Blockly.Arduino.logic_boolean=function(a){return["TRUE"==a.getFieldValue("BOOL")?"true":"false",Blockly.Arduino.ORDER_ATOMIC]};Blockly.Arduino.logic_null=function(a){return["NULL",Blockly.Arduino.ORDER_ATOMIC]}; +Blockly.Arduino.logic_ternary=function(a){var b=Blockly.Arduino.valueToCode(a,"IF",Blockly.Arduino.ORDER_CONDITIONAL)||"false",c=Blockly.Arduino.valueToCode(a,"THEN",Blockly.Arduino.ORDER_CONDITIONAL)||"null";a=Blockly.Arduino.valueToCode(a,"ELSE",Blockly.Arduino.ORDER_CONDITIONAL)||"null";return[b+" ? "+c+" : "+a,Blockly.Arduino.ORDER_CONDITIONAL]};Blockly.Arduino.loops={};Blockly.Arduino.controls_repeat=function(a){var b=Number(a.getFieldValue("TIMES")),c=Blockly.Arduino.statementToCode(a,"DO"),c=Blockly.Arduino.addLoopTrap(c,a.id);a=Blockly.Arduino.variableDB_.getDistinctName("count",Blockly.Variables.NAME_TYPE);return"for (int "+a+" = 0; "+a+" < "+b+"; "+a+"++) {\n"+c+"}\n"}; +Blockly.Arduino.controls_repeat_ext=function(a){var b=Blockly.Arduino.valueToCode(a,"TIMES",Blockly.Arduino.ORDER_ADDITIVE)||"0",c=Blockly.Arduino.statementToCode(a,"DO"),c=Blockly.Arduino.addLoopTrap(c,a.id);a="";var d=Blockly.Arduino.variableDB_.getDistinctName("count",Blockly.Variables.NAME_TYPE),e=b;b.match(/^\w+$/)||Blockly.isNumber(b)||(e=Blockly.Arduino.variableDB_.getDistinctName("repeat_end",Blockly.Variables.NAME_TYPE),a+="int "+e+" = "+b+";\n");return a+("for (int "+d+" = 0; "+d+" < "+ +e+"; "+d+"++) {\n"+c+"}\n")};Blockly.Arduino.controls_whileUntil=function(a){var b="UNTIL"==a.getFieldValue("MODE"),c=Blockly.Arduino.valueToCode(a,"BOOL",b?Blockly.Arduino.ORDER_LOGICAL_OR:Blockly.Arduino.ORDER_NONE)||"false",d=Blockly.Arduino.statementToCode(a,"DO"),d=Blockly.Arduino.addLoopTrap(d,a.id);b&&(c.match(/^\w+$/)||(c="("+c+")"),c="!"+c);return"while ("+c+") {\n"+d+"}\n"}; +Blockly.Arduino.controls_for=function(a){var b=Blockly.Arduino.variableDB_.getName(a.getFieldValue("VAR"),Blockly.Variables.NAME_TYPE),c=Blockly.Arduino.valueToCode(a,"FROM",Blockly.Arduino.ORDER_ASSIGNMENT)||"0",d=Blockly.Arduino.valueToCode(a,"TO",Blockly.Arduino.ORDER_ASSIGNMENT)||"0",e=Blockly.Arduino.valueToCode(a,"BY",Blockly.Arduino.ORDER_ASSIGNMENT)||"1",f=Blockly.Arduino.statementToCode(a,"DO"),f=Blockly.Arduino.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.Arduino.variableDB_.getDistinctName(b+"_start",Blockly.Variables.NAME_TYPE),a+="int "+g+" = "+c+";\n"),c=d,d.match(/^\w+$/)||Blockly.isNumber(d)||(c=Blockly.Arduino.variableDB_.getDistinctName(b+"_end",Blockly.Variables.NAME_TYPE),a+="int "+c+" = "+d+";\n"),d=Blockly.Arduino.variableDB_.getDistinctName(b+ +"_inc",Blockly.Variables.NAME_TYPE),a+="int "+d+" = ",a=Blockly.isNumber(e)?a+(Math.abs(e)+";\n"):a+("abs("+e+");\n"),a=a+("if ("+g+" > "+c+") {\n")+(Blockly.Arduino.INDENT+d+" = -"+d+";\n"),a+="}\n",a+="for ("+b+" = "+g+";\n "+d+" >= 0 ? "+b+" <= "+c+" : "+b+" >= "+c+";\n "+b+" += "+d+") {\n"+f+"}\n";return a};Blockly.Arduino.controls_forEach=Blockly.Arduino.noGeneratorCodeLine; +Blockly.Arduino.controls_flow_statements=function(a){switch(a.getFieldValue("FLOW")){case "BREAK":return"break;\n";case "CONTINUE":return"continue;\n"}throw"Unknown flow statement.";};Blockly.Arduino.map={};Blockly.Arduino.base_map=function(a){var b=Blockly.Arduino.valueToCode(a,"NUM",Blockly.Arduino.ORDER_NONE)||"0";a=Blockly.Arduino.valueToCode(a,"DMAX",Blockly.Arduino.ORDER_ATOMIC)||"0";return["map("+b+", 0, 1024, 0, "+a+")",Blockly.Arduino.ORDER_NONE]};Blockly.Arduino.math={};Blockly.Arduino.math_number=function(a){a=parseFloat(a.getFieldValue("NUM"));Infinity==a?a="INFINITY":-Infinity==a&&(a="-INFINITY");return[a,Blockly.Arduino.ORDER_ATOMIC]}; +Blockly.Arduino.math_arithmetic=function(a){var b={ADD:[" + ",Blockly.Arduino.ORDER_ADDITIVE],MINUS:[" - ",Blockly.Arduino.ORDER_ADDITIVE],MULTIPLY:[" * ",Blockly.Arduino.ORDER_MULTIPLICATIVE],DIVIDE:[" / ",Blockly.Arduino.ORDER_MULTIPLICATIVE],POWER:[null,Blockly.Arduino.ORDER_NONE]}[a.getFieldValue("OP")],c=b[0],b=b[1],d=Blockly.Arduino.valueToCode(a,"A",b)||"0";a=Blockly.Arduino.valueToCode(a,"B",b)||"0";return c?[d+c+a,b]:["Math.pow("+d+", "+a+")",Blockly.Arduino.ORDER_UNARY_POSTFIX]}; +Blockly.Arduino.math_single=function(a){var b=a.getFieldValue("OP"),c;if("NEG"==b)return a=Blockly.Arduino.valueToCode(a,"NUM",Blockly.Arduino.ORDER_UNARY_PREFIX)||"0","-"==a[0]&&(a=" "+a),["-"+a,Blockly.Arduino.ORDER_UNARY_PREFIX];a="ABS"==b||"ROUND"==b.substring(0,5)?Blockly.Arduino.valueToCode(a,"NUM",Blockly.Arduino.ORDER_UNARY_POSTFIX)||"0":"SIN"==b||"COS"==b||"TAN"==b?Blockly.Arduino.valueToCode(a,"NUM",Blockly.Arduino.ORDER_MULTIPLICATIVE)||"0":Blockly.Arduino.valueToCode(a,"NUM",Blockly.Arduino.ORDER_NONE)|| +"0";switch(b){case "ABS":c="abs("+a+")";break;case "ROOT":c="sqrt("+a+")";break;case "LN":c="log("+a+")";break;case "EXP":c="exp("+a+")";break;case "POW10":c="pow(10,"+a+")";break;case "ROUND":c="round("+a+")";break;case "ROUNDUP":c="ceil("+a+")";break;case "ROUNDDOWN":c="floor("+a+")";break;case "SIN":c="sin("+a+" / 180 * Math.PI)";break;case "COS":c="cos("+a+" / 180 * Math.PI)";break;case "TAN":c="tan("+a+" / 180 * Math.PI)"}if(c)return[c,Blockly.Arduino.ORDER_UNARY_POSTFIX];switch(b){case "LOG10":c= +"log("+a+") / log(10)";break;case "ASIN":c="asin("+a+") / M_PI * 180";break;case "ACOS":c="acos("+a+") / M_PI * 180";break;case "ATAN":c="atan("+a+") / M_PI * 180";break;default:throw"Unknown math operator: "+b;}return[c,Blockly.Arduino.ORDER_MULTIPLICATIVE]}; +Blockly.Arduino.math_constant=function(a){return{PI:["M_PI",Blockly.Arduino.ORDER_UNARY_POSTFIX],E:["M_E",Blockly.Arduino.ORDER_UNARY_POSTFIX],GOLDEN_RATIO:["(1 + sqrt(5)) / 2",Blockly.Arduino.ORDER_MULTIPLICATIVE],SQRT2:["M_SQRT2",Blockly.Arduino.ORDER_UNARY_POSTFIX],SQRT1_2:["M_SQRT1_2",Blockly.Arduino.ORDER_UNARY_POSTFIX],INFINITY:["INFINITY",Blockly.Arduino.ORDER_ATOMIC]}[a.getFieldValue("CONSTANT")]}; +Blockly.Arduino.math_number_property=function(a){var b=Blockly.Arduino.valueToCode(a,"NUMBER_TO_CHECK",Blockly.Arduino.ORDER_MULTIPLICATIVE)||"0",c=a.getFieldValue("PROPERTY"),d;if("PRIME"==c)return a=Blockly.Arduino.addFunction("mathIsPrime",["boolean "+Blockly.Arduino.DEF_FUNC_NAME+"(int n) {"," // https://en.wikipedia.org/wiki/Primality_test#Naive_methods\n if (n == 2 || n == 3) {\n return true;\n }\n // False if n is NaN, negative, is 1.\n // And false if n is divisible by 2 or 3.\n if (isnan(n) || (n <= 1) || (n == 1) || (n % 2 == 0) || (n % 3 == 0)) {\n return false;\n }\n // Check all the numbers of form 6k +/- 1, up to sqrt(n).\n for (int x = 6; x <= sqrt(n) + 1; x += 6) {\n if (n % (x - 1) == 0 || n % (x + 1) == 0) {\n return false;\n }\n }\n return true;\n}"].join("\n")), +Blockly.Arduino.addInclude("math","#include "),[a+"("+b+")",Blockly.Arduino.ORDER_UNARY_POSTFIX];switch(c){case "EVEN":d=b+" % 2 == 0";break;case "ODD":d=b+" % 2 == 1";break;case "WHOLE":Blockly.Arduino.addInclude("math","#include ");d="(floor("+b+") == "+b+")";break;case "POSITIVE":d=b+" > 0";break;case "NEGATIVE":d=b+" < 0";break;case "DIVISIBLE_BY":a=Blockly.Arduino.valueToCode(a,"DIVISOR",Blockly.Arduino.ORDER_MULTIPLICATIVE)||"0",d=b+" % "+a+" == 0"}return[d,Blockly.Arduino.ORDER_EQUALITY]}; +Blockly.Arduino.math_change=function(a){var b=Blockly.Arduino.valueToCode(a,"DELTA",Blockly.Arduino.ORDER_ADDITIVE)||"0";return Blockly.Arduino.variableDB_.getName(a.getFieldValue("VAR"),Blockly.Variables.NAME_TYPE)+" += "+b+";\n"};Blockly.Arduino.math_round=Blockly.Arduino.math_single;Blockly.Arduino.math_trig=Blockly.Arduino.math_single;Blockly.Arduino.math_on_list=Blockly.Arduino.noGeneratorCodeInline; +Blockly.Arduino.math_modulo=function(a){var b=Blockly.Arduino.valueToCode(a,"DIVIDEND",Blockly.Arduino.ORDER_MULTIPLICATIVE)||"0";a=Blockly.Arduino.valueToCode(a,"DIVISOR",Blockly.Arduino.ORDER_MULTIPLICATIVE)||"0";return[b+" % "+a,Blockly.Arduino.ORDER_MULTIPLICATIVE]}; +Blockly.Arduino.math_constrain=function(a){var b=Blockly.Arduino.valueToCode(a,"VALUE",Blockly.Arduino.ORDER_NONE)||"0",c=Blockly.Arduino.valueToCode(a,"LOW",Blockly.Arduino.ORDER_NONE)||"0";a=Blockly.Arduino.valueToCode(a,"HIGH",Blockly.Arduino.ORDER_NONE)||"0";return["("+b+" < "+c+" ? "+c+" : ( "+b+" > "+a+" ? "+a+" : "+b+"))",Blockly.Arduino.ORDER_UNARY_POSTFIX]}; +Blockly.Arduino.math_random_int=function(a){var b=Blockly.Arduino.valueToCode(a,"FROM",Blockly.Arduino.ORDER_NONE)||"0";a=Blockly.Arduino.valueToCode(a,"TO",Blockly.Arduino.ORDER_NONE)||"0";var c=Blockly.Arduino.variableDB_.getDistinctName("math_random_int",Blockly.Generator.NAME_TYPE);Blockly.Arduino.math_random_int.random_function=c;return[Blockly.Arduino.addFunction("mathRandomInt",["int "+Blockly.Arduino.DEF_FUNC_NAME+"(int min, int max) {"," if (min > max) {\n // Swap min and max to ensure min is smaller.\n int temp = min;\n min = max;\n max = temp;\n }\n return min + (rand() % (max - min + 1));\n}"].join("\n"))+ +"("+b+", "+a+")",Blockly.Arduino.ORDER_UNARY_POSTFIX]};Blockly.Arduino.math_random_float=function(a){return["(rand() / RAND_MAX)",Blockly.Arduino.ORDER_UNARY_POSTFIX]};Blockly.Arduino.procedures={}; +Blockly.Arduino.procedures_defreturn=function(a){var b=Blockly.Arduino.variableDB_.getName(a.getFieldValue("NAME"),Blockly.Procedures.NAME_TYPE),c=Blockly.Arduino.statementToCode(a,"STACK");Blockly.Arduino.STATEMENT_PREFIX&&(c=Blockly.Arduino.prefixLines(Blockly.Arduino.STATEMENT_PREFIX.replace(/%1/g,"'"+a.id+"'"),Blockly.Arduino.INDENT)+c);Blockly.Arduino.INFINITE_LOOP_TRAP&&(c=Blockly.Arduino.INFINITE_LOOP_TRAP.replace(/%1/g,"'"+a.id+"'")+c);var d=Blockly.Arduino.valueToCode(a,"RETURN",Blockly.Arduino.ORDER_NONE)|| +"";d&&(d=" return "+d+";\n");for(var e=[],f=0;f");Blockly.Arduino.addDeclaration("servo_"+b,"Servo "+d+";");Blockly.Arduino.addSetup("servo_"+b,d+".attach("+b+");",!0);return d+".write("+c+");\n"}; +Blockly.Arduino.servo_read=function(a){var b=a.getFieldValue("SERVO_PIN"),c="myServo"+b;Blockly.Arduino.reservePin(a,b,Blockly.Arduino.PinTypes.SERVO,"Servo Read");Blockly.Arduino.addInclude("servo","#include ");Blockly.Arduino.addDeclaration("servo_"+b,"Servo "+c+";");Blockly.Arduino.addSetup("servo_"+b,c+".attach("+b+");",!0);return[c+".read()",Blockly.Arduino.ORDER_ATOMIC]};Blockly.Arduino.spi={}; +Blockly.Arduino.spi_setup=function(a){var b=a.getFieldValue("SPI_ID"),c=a.getFieldValue("SPI_SHIFT_ORDER"),d=a.getFieldValue("SPI_CLOCK_DIVIDE");a=a.getFieldValue("SPI_MODE");Blockly.Arduino.addInclude("spi","#include ");Blockly.Arduino.addSetup("spi_order",b+".setBitOrder("+c+");",!0);Blockly.Arduino.addSetup("spi_mode",b+".setDataMode("+a+");",!0);Blockly.Arduino.addSetup("spi_div",b+".setClockDivider("+d+");",!0);Blockly.Arduino.addSetup("spi_begin",b+".begin();",!0);return""}; +Blockly.Arduino.spi_transfer=function(a){var b=a.getFieldValue("SPI_ID"),c=a.getFieldValue("SPI_SS"),d=Blockly.Arduino.valueToCode(a,"SPI_DATA",Blockly.Arduino.ORDER_ATOMIC)||"0";Blockly.Arduino.addInclude("spi","#include ");Blockly.Arduino.addSetup("spi_begin",b+".begin();",!1);for(var e=Blockly.Arduino.Boards.selected.spiPins[b],f=0;f");Blockly.Arduino.addDeclaration(c,e);Blockly.Arduino.addSetup(c,c+".setSpeed("+f+");",!0);return""}; +Blockly.Arduino.stepper_step=function(a){var b="stepper_"+a.getFieldValue("STEPPER_NAME");a=Blockly.Arduino.valueToCode(a,"STEPPER_STEPS",Blockly.Arduino.ORDER_ATOMIC)||"0";return b+".step("+a+");\n"};Blockly.Arduino.text={};Blockly.Arduino.text=function(a){return[Blockly.Arduino.quote_(a.getFieldValue("TEXT")),Blockly.Arduino.ORDER_ATOMIC]}; +Blockly.Arduino.text_join=function(a){var b;if(0==a.itemCount_)return['""',Blockly.Arduino.ORDER_ATOMIC];if(1==a.itemCount_)return["String("+(Blockly.Arduino.valueToCode(a,"ADD0",Blockly.Arduino.ORDER_UNARY_POSTFIX)||'""')+")",Blockly.Arduino.ORDER_UNARY_POSTFIX];var c;b=[];for(var d=0;d\x3c/script>')},goog.appendScriptSrcNode_=function(a){var b=goog.global.document,c=b.createElement("script");c.type="text/javascript";c.src= +a;c.defer=!1;c.async=!1;b.head.appendChild(c)},goog.writeScriptTag_=function(a,b){if(goog.inHtmlDocument_()){var c=goog.global.document;if(!goog.ENABLE_CHROME_APP_SAFE_SCRIPT_LOADING&&"complete"==c.readyState){if(/\bdeps.js$/.test(a))return!1;throw Error('Cannot write "'+a+'" after document load');}if(void 0===b)if(goog.IS_OLD_IE_){goog.oldIeWaiting_=!0;var d=" onreadystatechange='goog.onScriptLoad_(this, "+ ++goog.lastNonModuleScriptIndex_+")' ";c.write('