Thanks to visit codestin.com
Credit goes to docs.rs

Crate kartoffel

Crate kartoffel 

Source
Expand description

§kartoffel

This crate provides building blocks for implementing a bot for the kartoffels game - see:

https://github.com/patryk27/kartoffel

Macros§

print
Prints to the serial port.
println
Prints to the serial port, with a newline.

Structs§

RadarScan
Outcome of a radar scan such as radar_scan_3x3().
Serial
Allows to write!() and writeln!() 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.