Expand description
§kartoffel
This crate provides building blocks for implementing a bot for the kartoffels game - see:
Macros§
Structs§
- Radar
Scan - Outcome of a radar scan such as
radar_scan_3x3(). - Serial
- Allows to
write!()andwriteln!()into the serial port.
Functions§
- arm_
drop - Takes object from the inventory and drops it in front of you, shifting following objects into their previous indices.
- arm_
pick - Picks the object in front of you and puts it into the inventory under the zeroth index, shifting previously-picked objects into further indices.
- arm_
stab - Stabs the bot in front of you, killing it.
- arm_
wait - Waits for the arm to become ready.
- compass_
dir - Returns which direction the bot was facing at the time of the latest measurement, and then removes that measurement from the compass.
- is_
arm_ ready - Returns whether the arm is ready and
arm_stab()can be invoked. - is_
motor_ ready - Returns whether the motor is ready and
motor_pulse()can be invoked. - is_
radar_ ready - Returns whether the radar is ready and
radar_scan()can be invoked. - motor_
pulse - Sends a pulse to the motors.
- motor_
step_ bw - Moves the bot one tile away (backward) from the direction it’s facing.
- motor_
step_ fw - Moves the bot one tile forward in the direction it’s facing.
- motor_
turn_ left - Turns the bot to its left (i.e. counterclockwise).
- motor_
turn_ right - Turns the bot to its right (i.e. clockwise).
- motor_
wait - Waits for the motor to become ready.
- radar_
read - Reads data from the radar.
- radar_
scan - Scans a square around the bot.
- radar_
scan_ 3x3 - Scans a 3x3 square around the bot and returns the scanned area.
- radar_
scan_ 5x5 - Scans a 5x5 square around the bot and returns the scanned area.
- radar_
scan_ 7x7 - Scans a 7x7 square around the bot and returns the scanned area.
- radar_
scan_ 9x9 - Scans a 9x9 square around the bot and returns the scanned area.
- radar_
wait - Waits for the radar to become ready.
- serial_
buffer - Enables buffering.
- serial_
clear - Clears buffered characters.
- serial_
flush - Flushes buffered characters.
- serial_
write - Writes a single character to the serial port.
- timer_
seed - Returns a pseudorandom number that can be used as a source of randomness for hashmaps and the like.
- timer_
ticks - Returns the number of ticks that have passed since the bot’s been born.
- timer_
wait - Waits until given number of ticks has passed.