Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Assignments = make(map[string]Assignment)
View Source
var Events = map[string]func(g *generator, stmt *parser.StmtEvent) (*blocks.Block, error){ "launch": eventLaunch, "button": eventButton, "joystick": eventDirectionKey, "tilt": eventAction(blocks.EventDetectAttitude, "tilt", "left", "right", "forward", "backward"), "face": eventAction(blocks.EventDetectAttitude, "face", "up", "down"), "wave": eventAction(blocks.EventDetectAction, "wave", "left", "right"), "rotate": eventAction(blocks.EventDetectAction, "", "clockwise", "anticlockwise"), "fall": eventActionSingle(blocks.EventDetectAction, "freefall"), "shake": eventActionSingle(blocks.EventDetectAction, "shake"), "light": eventSensor("light_sensor"), "sound": eventSensor("microphone"), "shakeval": eventSensor("shakeval"), "timer": eventSensor("timer"), "receive": eventReceive, }
View Source
var ExprFuncCalls = map[string]ExprFuncCall{ "mbot.isButtonPressed": exprFuncIsButtonPressed, "mbot.buttonPressCount": exprFuncButtonPressCount, "mbot.isJoystickPulled": exprFuncIsJoystickPulled, "mbot.joystickPullCount": exprFuncJoystickPullCount, "lights.front.brightness": exprFuncLEDAmbientBrightness, "sensors.isTilted": exprFuncIsTilted, "sensors.isFaceUp": exprFuncIsFaceUp, "sensors.isWaving": exprFuncDetectAction([]string{"up", "down", "left", "right"}, "wave"), "sensors.isRotating": exprFuncDetectAction([]string{"clockwise", "anticlockwise"}, ""), "sensors.isFalling": exprFuncDetectSingleAction("freefall"), "sensors.isShaking": exprFuncDetectSingleAction("shake"), "sensors.tiltAngle": exprFuncTiltAngle([]string{"forward", "backward", "left", "right"}), "sensors.rotationAngle": exprFuncTiltAngle([]string{"clockwise", "anticlockwise"}), "sensors.acceleration": exprFuncAcceleration, "sensors.rotation": exprFuncRotation, "sensors.angleSpeed": exprFuncAngleSpeed, "sensors.colorStatus": exprFuncColorStatus, "sensors.getColorValue": exprFuncGetColorValue, "sensors.getColorName": exprFuncGetColorName, "sensors.isColorStatus": exprFuncIsColorStatus, "sensors.detectColor": exprFuncDetectColor, "motors.rpm": exprFuncMotorsSpeed("speed"), "motors.power": exprFuncMotorsSpeed("power"), "motors.angle": exprFuncMotorsAngle, "net.receive": exprFuncNetReceive, "math.round": exprFuncMathRound, "math.random": exprFuncMathRandom, "math.abs": exprFuncMathOp("abs"), "math.floor": exprFuncMathOp("floor"), "math.ceil": exprFuncMathOp("ceil"), "math.sqrt": exprFuncMathOp("sqrt"), "math.sin": exprFuncMathOp("sin"), "math.cos": exprFuncMathOp("cos"), "math.tan": exprFuncMathOp("tan"), "math.asin": exprFuncMathOp("asin"), "math.acos": exprFuncMathOp("acos"), "math.atan": exprFuncMathOp("atan"), "math.ln": exprFuncMathOp("ln"), "math.log": exprFuncMathOp("log"), "math.ePowerOf": exprFuncMathOp("e ^"), "math.tenPowerOf": exprFuncMathOp("10 ^"), "strings.length": exprFuncStringsLength, "strings.letter": exprFuncStringsLetter, "strings.contains": exprFuncStringsContains, "lists.get": exprFuncListsGet, "lists.indexOf": exprFuncListsIndexOf, "lists.length": exprFuncListsLength, "lists.contains": exprFuncListsContains, "display.pixelIsColor": exprFuncDisplayPixelIsColor, "sprite.touchesSprite": exprFuncSpriteTouchesSprite, "sprite.touchesEdge": exprFuncSpriteTouchesEdge, "sprite.positionX": exprFuncSpritePosition("get_x"), "sprite.positionY": exprFuncSpritePosition("get_y"), "sprite.rotation": exprFuncSpritePosition("get_rotation"), "sprite.scale": exprFuncSpritePosition("get_size"), "sprite.anchor": exprFuncSpritePosition("get_align"), "convert.toString": exprFuncConvert("str"), "convert.toNumber": exprFuncConvert("float"), }
View Source
var FuncCalls = map[string]FuncCall{}/* 113 elements not displayed */
View Source
var Variables = make(map[string]Var)
Functions ¶
func GenerateBlocks ¶
Types ¶
type Assignment ¶
type ExprFuncCall ¶
type ExprFuncCall func(g *generator, expr *parser.ExprFuncCall) (*blocks.Block, error)
type GenerateError ¶
func (GenerateError) Error ¶
func (e GenerateError) Error() string
Click to show internal directories.
Click to hide internal directories.