Last active
December 5, 2021 11:16
-
-
Save TrueBrain/fe878869c896aa070ff477c45cc3463e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I wrote: | |
/* Set the production / acceptance of the industry. */ | |
GitHub CoPilot wrote: | |
let mut production_output = Vec::new(); | |
for cargo_label in &industry.production { | |
production_output.extend(ctt[cargo_label].to_le_bytes()); | |
} | |
let mut acceptance_output = Vec::new(); | |
for cargo_label in &industry.acceptance { | |
acceptance_output.extend(ctt[cargo_label].to_le_bytes()); | |
} | |
Which is nearly exactly what I would have done, with the difference of the variable name. | |
Next I wrote: | |
write_pseudo_sprite(output, &[b"\x00\x0a\x01\x01", &[industry.id], b"\x25", &[industry.production.len() as u8], &production_output]); | |
After which GitHub CoPilot wrote: | |
write_pseudo_sprite(output, &[b"\x00\x0a\x01\x01", &[industry.id], b"\x26", &[industry.acceptance.len() as u8], &acceptance_output]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment