Sparki-learning

Latest version: v1.6.9

Safety actively analyzes 682361 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 4 of 4

1.1.0

Updated the python library with the grid commands.

drawFunction(function, xvals) - draws the function given on the coordinate plane; the function given as the argument should be a lambda function which calculates the y coordinate for a given x; the xvals argument should be an iterable of the x values for which to calculate a y value; a test / example python file has also been added demonstrating the use of this function

getAngle() - returns the current heading of the robot in degrees, where Sparki starts at 0 degrees when initialized; only turns done through turnBy() will be "tracked" for the purposes of this command; a heading of 0 is treated as going up the y axis

getPosition() - returns the current position of Sparki on the coordinate plane

moveBy(x,y) - moves to the x,y position relative to the current position; the behavior of this command is exactly the same as a moveTo() executed immediately following initialization

moveTo(x,y) - moves to the x,y position indicated on the coordinate plane

resetPosition() - resets the position to a heading of 0 and a current position of 0,0

setAngle(degrees) - sets the current heading of the Sparki

setPosition(x,y) - sets the current position on the coordinate plane

The turnTo(degrees) command has had its behavior changed since the previous version. It will now turn to the heading given as the argument.

Page 4 of 4

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.