Last active
November 3, 2016 10:49
-
-
Save tjvr/bf635170a4441d5bbaac8fde05685c77 to your computer and use it in GitHub Desktop.
all the workarounds
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// navigate to https://scratchblocks.github.io/ and open console | |
// paste in `var results = <json from above>` | |
function code(x) { return scratchblocks.parse(x).scripts[0].blocks[0].info.selector; } | |
function script(x) { return walk(scratchblocks.parse(x).scripts[0]); } | |
var things = results.map(row => ({ block: code(row[0]), workaround: script(row[1]) })) | |
function walk(x) { | |
var blocks = []; | |
if (x.isScript) { | |
x.blocks.forEach(function(block) { | |
[].push.apply(blocks, walk(block)); | |
}); | |
} else if (x.isBlock) { | |
blocks.push(x.info.selector); | |
x.children.forEach(function(child) { | |
if (child.isBlock) { | |
[].push.apply(blocks, walk(child)); | |
} | |
}); | |
} | |
return blocks; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[{"block":"whenGreenFlag","workaround":["whenIReceive",null]},{"block":"whenGreenFlag","workaround":["whenSensorGreaterThan","doIf","|","&",null,"mouseY","mousePressed","=","readVariable"]},{"block":"whenKeyPressed","workaround":["whenSensorGreaterThan","doForever"]},{"block":"whenClicked","workaround":["whenSensorGreaterThan","doForever"]},{"block":"whenClicked","workaround":["whenSensorGreaterThan","doForever"]},{"block":"whenSensorGreaterThan","workaround":["whenGreenFlag","doForever"]},{"block":"broadcast:","workaround":["whenGreenFlag","setVar:to:",null,"setVar:to:"]},{"block":"broadcast:","workaround":["doBroadcastAndWait"]},{"block":"doBroadcastAndWait","workaround":["whenGreenFlag","setVar:to:","setVar:to:",null,"setVar:to:","setVar:to:","doWaitUntil","=","readVariable",null]},{"block":"doBroadcastAndWait","workaround":["setVar:to:","broadcast:"]},{"block":"wait:elapsed:from:","workaround":["rest:elapsed:from:","*","/","tempo"]},{"block":"wait:elapsed:from:","workaround":["timerReset","doUntil","not","<","timer"]},{"block":"doForever","workaround":["doUntil"]},{"block":"doForever","workaround":["doRepeat","computeFunction:of:"]},{"block":"doRepeat","workaround":["setVar:to:","doUntil","=","readVariable"]},{"block":"doUntil","workaround":["procDef","call","doIf","not",null]},{"block":"doUntil","workaround":["broadcast:"]},{"block":"doIf","workaround":["doIfElse",null]},{"block":"doIf","workaround":["doBroadcastAndWait",null]},{"block":"doIf","workaround":["whenGreenFlag","doForever"]},{"block":"doIfElse","workaround":["doIf","doIf","not"]},{"block":"doIfElse","workaround":["procDef","doIf",null,"doIf","getParam"]},{"block":"doWaitUntil","workaround":["doUntil",null]},{"block":"stopScripts","workaround":["doWaitUntil"]},{"block":"stopScripts","workaround":["wait:elapsed:from:","computeFunction:of:"]},{"block":"stopScripts","workaround":["doForever"]},{"block":"stopScripts","workaround":["whenIReceive","stopScripts"]},{"block":"heading","workaround":["getAttribute:of:"]},{"block":"xpos","workaround":["getAttribute:of:"]},{"block":"ypos","workaround":["getAttribute:of:"]},{"block":"gotoSpriteOrMouse:","workaround":["gotoX:y:","mouseX","mouseY"]},{"block":"gotoSpriteOrMouse:","workaround":["gotoX:y:","getAttribute:of:","getAttribute:of:"]},{"block":"gotoSpriteOrMouse:","workaround":["xpos:","getAttribute:of:","ypos:","getAttribute:of:"]},{"block":"gotoX:y:","workaround":["xpos:","readVariable","ypos:","readVariable"]},{"block":"gotoX:y:","workaround":["glideSecs:toX:y:elapsed:from:"]},{"block":"pointTowards:","workaround":["setVar:to:","-","getAttribute:of:","xpos","setVar:to:","-","getAttribute:of:","ypos","doIfElse","=","readVariable"]},{"block":"heading:","workaround":["turnRight:","-","heading"]},{"block":"heading:","workaround":["turnLeft:","*","-","heading"]},{"block":"turnRight:","workaround":["heading:","+","heading"]},{"block":"turnLeft:","workaround":["heading:","-","heading"]},{"block":"forward:","workaround":["gotoX:y:","+","xpos","*","computeFunction:of:","heading","+","ypos","*","computeFunction:of:","heading"]},{"block":"forward:","workaround":["changeXposBy:","*","computeFunction:of:","heading","changeYposBy:","*","computeFunction:of:","heading"]},{"block":"changeXposBy:","workaround":["xpos:","+","xpos"]},{"block":"changeYposBy:","workaround":["ypos:","+","ypos"]},{"block":"xpos:","workaround":["changeXposBy:","-","readVariable","xpos"]},{"block":"xpos:","workaround":["changeXposBy:","+","*","xpos","readVariable"]},{"block":"xpos:","workaround":["gotoX:y:","readVariable","ypos"]},{"block":"ypos:","workaround":["changeYposBy:","-","readVariable","ypos"]},{"block":"ypos:","workaround":["changeYposBy:","+","*","ypos","readVariable"]},{"block":"ypos:","workaround":["gotoX:y:","xpos","readVariable"]},{"workaround":[null,"wait:elapsed:from:","readVariable",null]},{"workaround":[null]},{"workaround":[null]},{"block":"lookLike:","workaround":["doUntil","=","readVariable","costumeIndex"]},{"block":"nextCostume","workaround":["lookLike:","+","costumeIndex"]},{"block":"startScene","workaround":["doUntil","=","readVariable","backgroundIndex"]},{"block":"nextScene","workaround":["startScene","+","backgroundIndex"]},{"block":"nextScene","workaround":["startScene"]},{"block":"costumeIndex","workaround":["getAttribute:of:"]},{"block":"backgroundIndex","workaround":["getAttribute:of:"]},{"block":"sceneName","workaround":["getAttribute:of:"]},{"block":"say:duration:elapsed:from:","workaround":["say:","readVariable","wait:elapsed:from:","readVariable","say:"]},{"block":"think:duration:elapsed:from:","workaround":["think:","readVariable","wait:elapsed:from:","readVariable","think:"]},{"block":"filterReset","workaround":["setGraphicEffect:to:","setGraphicEffect:to:","setGraphicEffect:to:","setGraphicEffect:to:","setGraphicEffect:to:","setGraphicEffect:to:","setGraphicEffect:to:"]},{"block":"scale","workaround":["getAttribute:of:"]},{"block":"changeSizeBy:","workaround":["setSizeTo:","+","scale","readVariable"]},{"block":"setSizeTo:","workaround":["changeSizeBy:","-","readVariable","scale"]},{"block":"comeToFront","workaround":["goBackByLayers:","*","computeFunction:of:"]},{"block":"hide","workaround":["setGraphicEffect:to:"]},{"block":"hide","workaround":["lookLike:"]},{"block":"playSound:","workaround":[null,"broadcast:","doPlaySoundAndWait"]},{"block":"doPlaySoundAndWait","workaround":["playSound:","wait:elapsed:from:","readVariable"]},{"block":"rest:elapsed:from:","workaround":["wait:elapsed:from:","*","/","tempo","readVariable"]},{"block":"changeVolumeBy:","workaround":["setVolumeTo:","+","volume","readVariable"]},{"block":"setVolumeTo:","workaround":["changeVolumeBy:","-","readVariable","volume"]},{"block":"volume","workaround":["getAttribute:of:"]},{"block":"changeTempoBy:","workaround":["setTempoTo:","+","tempo","readVariable"]},{"block":"setTempoTo:","workaround":["changeTempoBy:","-","readVariable","tempo"]},{"block":"+","workaround":["-","readVariable","*","readVariable"]},{"block":"+","workaround":["-","readVariable","-","readVariable"]},{"block":"+","workaround":["setVar:to:","readVariable","changeVar:by:","readVariable"]},{"block":"-","workaround":["+","readVariable","*","readVariable"]},{"block":"-","workaround":["+","readVariable","/","readVariable"]},{"block":"-","workaround":["+","readVariable","concatenate:with:","readVariable"]},{"block":"-","workaround":["setVar:to:","changeVar:by:","*"]},{"block":"*","workaround":["deleteLine:ofList:","deleteLine:ofList:","deleteLine:ofList:","setVar:to:","setVar:to:","setVar:to:","doIfElse","<","answer","doRepeat","stringLength:","doIfElse","<","doRepeat","stringLength:","setVar:to:","contentsOfList:","setVar:to:","contentsOfList:","doRepeat","readVariable","setVar:to:","+","readVariable","readVariable","setVar:to:","doRepeat","stringLength:","readVariable","doIf","not","=","readVariable","doIf","&","|","=","readVariable","=","readVariable","not","&","=","readVariable","=","readVariable","setVar:to:","contentsOfList:"]},{"block":"*","workaround":["/","readVariable","/","readVariable"]},{"block":"*","workaround":["doIfElse","<","readVariable"]},{"block":"/","workaround":["deleteLine:ofList:","deleteLine:ofList:","setVar:to:","setVar:to:","setVar:to:","computeFunction:of:","setVar:to:","<","doIfElse","<","readVariable","setVar:to:","<","readVariable","doRepeat","stringLength:","readVariable","doRepeat","-","readVariable","doIfElse","=","rounded","readVariable","readVariable","setVar:to:","setVar:to:","doRepeat","lineCountOfList:"]},{"block":"/","workaround":["doIfElse","<","readVariable"]},{"workaround":["&","not","<","readVariable","readVariable","not","=","readVariable","readVariable"]},{"workaround":["&","not",">","readVariable","readVariable","not","=","readVariable","readVariable"]},{"workaround":["&","not","<","readVariable","readVariable","not",">","readVariable","readVariable"]},{"workaround":["deleteLine:ofList:","append:toList:","readVariable","doIf","list:contains:","readVariable"]},{"block":"&","workaround":["doIf",null]},{"block":"&","workaround":["not","|","not",null,"not",null]},{"block":"&","workaround":["setVar:to:","doUntil","=","readVariable"]},{"block":"&","workaround":["doIfElse"]},{"block":"|","workaround":["doIfElse",null]},{"block":"|","workaround":["not","&","not",null,"not",null]},{"block":"|","workaround":["doIfElse"]},{"block":"not","workaround":["=","readVariable"]},{"block":"not","workaround":["doIfElse"]},{"block":"concatenate:with:","workaround":["setVar:to:","setVar:to:","doRepeat","stringLength:","readVariable","setVar:to:","doRepeat","stringLength:","readVariable","setVar:to:","contentsOfList:"]},{"block":"concatenate:with:","workaround":[]},{"block":"letter:of:","workaround":[]},{"block":"stringLength:","workaround":["setVar:to:","doUntil","=","letter:of:","+","readVariable"]},{"block":"%","workaround":["doIfElse",">","rounded","/","readVariable","readVariable","/","readVariable","readVariable"]},{"block":"rounded","workaround":["setVar:to:","setVar:to:","doUntil","|","=","letter:of:","readVariable","readVariable","=","readVariable","stringLength:","readVariable","doIf","&","=","letter:of:","readVariable","readVariable",">","letter:of:","+","readVariable","readVariable"]},{"block":"rounded","workaround":["setVar:to:","setVar:to:","doUntil","<","computeFunction:of:","readVariable"]},{"block":"rounded","workaround":["procDef","rounded",null,"setVar:to:","doUntil","=","letter:of:","readVariable","getParam","changeVar:by:","doIfElse","=","letter:of:","readVariable","getParam"]},{"block":"computeFunction:of:","workaround":["setVar:to:","readVariable","doIf","<","readVariable"]},{"block":"computeFunction:of:","workaround":["setVar:to:","+","computeFunction:of:","*","readVariable","readVariable"]},{"block":"computeFunction:of:","workaround":["setVar:to:","readVariable","doUntil","=","readVariable","readVariable"]},{"block":"computeFunction:of:","workaround":["setVar:to:","computeFunction:of:","*","computeFunction:of:","readVariable"]},{"block":"computeFunction:of:","workaround":["setVar:to:","/","computeFunction:of:","readVariable","computeFunction:of:","computeFunction:of:"]},{"block":"computeFunction:of:","workaround":["setVar:to:","computeFunction:of:","*","readVariable"]},{"block":"computeFunction:of:","workaround":["setVar:to:","/","computeFunction:of:","readVariable","computeFunction:of:"]},{"block":"computeFunction:of:","workaround":["setVar:to:","computeFunction:of:","*","readVariable","computeFunction:of:"]},{"block":"computeFunction:of:","workaround":["setVar:to:","rounded","-","readVariable"]},{"block":"computeFunction:of:","workaround":["setVar:to:","rounded","+","readVariable"]},{"block":"computeFunction:of:","workaround":["setVar:to:","computeFunction:of:","-","readVariable"]},{"block":"computeFunction:of:","workaround":["setVar:to:","computeFunction:of:","-","readVariable"]},{"block":"computeFunction:of:","workaround":["setVar:to:","/","computeFunction:of:","readVariable","computeFunction:of:","readVariable"]},{"block":"stampCostume","workaround":["setVar:to:","createCloneOf","setVar:to:"]},{"block":"doAsk","workaround":["say:","readVariable","deleteLine:ofList:","setVar:to:","doUntil","&","touching:","mousePressed"]},{"block":"distanceTo:","workaround":["computeFunction:of:","+","*","-","getAttribute:of:","xpos","-","getAttribute:of:","xpos","*","-","getAttribute:of:","ypos","-","getAttribute:of:","ypos"]},{"block":"mouseX","workaround":["doForever"]},{"block":"mouseY","workaround":["doForever"]},{"block":"timestamp","workaround":["setVar:to:","+","-","*","readVariable","computeFunction:of:","/","*","+","readVariable","computeFunction:of:","/","+","readVariable","-","+","computeFunction:of:","/","*","readVariable","readVariable","doIf","<","readVariable","doIf","<","readVariable","doIf",">","readVariable","changeVar:by:"]},{"workaround":["<",null]},{"block":"readVariable","workaround":["getAttribute:of:"]},{"block":"readVariable","workaround":["getAttribute:of:"]},{"block":"setVar:to:","workaround":["changeVar:by:","+","*","readVariable","readVariable"]},{"block":"changeVar:by:","workaround":["setVar:to:","+","readVariable","readVariable"]},{"block":"contentsOfList:","workaround":["setVar:to:","setVar:to:","doUntil","|","=","readVariable",">","readVariable","lineCountOfList:","doIfElse","=","readVariable"]},{"block":"setLine:ofList:to:","workaround":["deleteLine:ofList:","readVariable","insert:at:ofList:","readVariable","readVariable"]},{"workaround":["setVar:to:","setVar:to:","doRepeat","lineCountOfList:"]},{"block":"lineCountOfList:","workaround":["stringLength:","readVariable"]},{"block":"append:toList:","workaround":["insert:at:ofList:"]},{"workaround":["broadcast:"]},{"block":"doForeverIf","workaround":["doForever"]},{"workaround":["createCloneOf"]},{"workaround":["lookLike:","+","costumeIndex"]},{"workaround":["startScene","+","backgroundIndex"]},{"workaround":["say:"]},{"workaround":["think:"]},{"workaround":["broadcast:"]},{"workaround":["whenIReceive","hide"]},{"workaround":["setGraphicEffect:to:","stampCostume","setGraphicEffect:to:"]},{"workaround":["computeFunction:of:"]},{"workaround":["computeFunction:of:"]},{"block":"isLoud","workaround":[">","soundLevel"]},{"workaround":["-","timestamp"]},{"workaround":["whenGreenFlag","doIf","not","list:contains:","getUserName","doUntil","=","getLine:ofList:","readVariable","getUserName"]},{"workaround":["say:","concatenate:with:","readVariable"]},{"workaround":["doIf","=","readVariable"]},{"workaround":["senseVideoMotion"]},{"workaround":["senseVideoMotion"]},{"workaround":["readVariable"]},{"workaround":["changeVar:by:"]},{"workaround":["setVar:to:"]},{"workaround":["doUntil","not",null]},{"workaround":["setVar:to:","doRepeat"]},{"workaround":["whenIReceive","setVar:to:",null,"setVar:to:"]},{"workaround":["whenIReceive","setVar:to:","wait:elapsed:from:","setVar:to:"]},{"workaround":["doIf","=","readVariable"]},{"workaround":["whenGreenFlag","setVar:to:"]},{"workaround":["=","readVariable"]},{"workaround":["whenIReceive","setVar:to:"]},{"block":"stopScripts","workaround":["broadcast:"]},{"workaround":["whenCloned","setVar:to:"]},{"workaround":["setVar:to:","createCloneOf","setVar:to:"]},{"workaround":["gotoX:y:","+","xpos","readVariable","+","ypos","readVariable"]},{"workaround":["changeXposBy:","readVariable","changeYposBy:","readVariable"]},{"workaround":["glideSecs:toX:y:elapsed:from:","readVariable","+","xpos","readVariable","+","ypos","readVariable"]},{"workaround":["glideSecs:toX:y:elapsed:from:","readVariable","+","xpos","*","computeFunction:of:","heading","readVariable","+","ypos","*","computeFunction:of:","heading","readVariable"]},{"workaround":["heading:","+","computeFunction:of:","/","-","readVariable","xpos","-","readVariable","ypos","*",">","ypos","readVariable"]},{"workaround":["computeFunction:of:","+","*","-","xpos","readVariable","-","xpos","readVariable","*","-","ypos","readVariable","-","ypos","readVariable"]},{"workaround":["setVar:to:","doAsk","setVar:to:"]},{"workaround":["whenClicked","setVar:to:","doWaitUntil","not","&","mousePressed","touching:","setVar:to:"]},{"workaround":["broadcast:"]},{"workaround":["whenIReceive","show"]},{"workaround":["lookLike:","-","costumeIndex"]},{"workaround":["startScene","-","backgroundIndex"]},{"workaround":["startScene"]},{"workaround":["getAttribute:of:"]},{"workaround":["goBackByLayers:","computeFunction:of:"]},{"workaround":["whenGreenFlag","changeVar:by:"]},{"workaround":["goBackByLayers:","-","readVariable"]},{"workaround":["computeFunction:of:","*","readVariable","computeFunction:of:","readVariable"]},{"workaround":["computeFunction:of:","*","readVariable","computeFunction:of:","readVariable"]},{"workaround":["not"]},{"workaround":["="]},{"workaround":["not","not"]},{"workaround":["&"]},{"workaround":["|"]},{"workaround":["="]},{"workaround":["not","="]},{"workaround":["not","<"]},{"workaround":["|",">","readVariable","readVariable","=","readVariable","readVariable"]},{"workaround":["not",">"]},{"workaround":["|","<","readVariable","readVariable","=","readVariable","readVariable"]},{"workaround":["doIfElse",null]},{"workaround":["+","*","readVariable",null,"*","readVariable","not",null]},{"workaround":["setVar:to:","setVar:to:","readVariable","doUntil","=","readVariable","+","readVariable"]},{"workaround":["%","computeFunction:of:","/","readVariable","computeFunction:of:","-","computeFunction:of:","readVariable"]},{"workaround":["*","rounded","/","readVariable","readVariable","readVariable"]},{"workaround":["/","rounded","*","readVariable","computeFunction:of:","readVariable","computeFunction:of:","readVariable"]},{"workaround":["doForever"]},{"workaround":["setVar:to:","doPlaySoundAndWait","setVar:to:"]},{"workaround":["playSound:","rest:elapsed:from:","stopAllSounds"]},{"workaround":["doForever"]},{"workaround":["setLine:ofList:to:","+","getLine:ofList:"]}] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment