Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fn main() {
- let mut checksum = 0;
- "N66555 G1 X131.338 Y133.349 E0.0091".chars().for_each(|c| {
- let mut buf = [0u8; 4];
- c.encode_utf8(&mut buf).bytes().for_each(|b| checksum ^= b);
- });
- println!("{}", checksum);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement