Created
July 31, 2024 19:03
-
-
Save scheibo/b21f57aa2d659fe6055f7a58e85b1199 to your computer and use it in GitHub Desktop.
delta
This file contains hidden or 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
| const endian = @import("builtin").cpu.arch.endian(); | |
| var bytes: usize = 0; | |
| const a = std.mem.toBytes(copy)[0..376]; | |
| const b = std.mem.toBytes(battle.*)[0..376]; | |
| var diffs: [128]u8 = undefined; | |
| var i: usize = 0; | |
| var j: usize = 0; | |
| while (i < 376) : (i += 2) { | |
| const ai = std.mem.bytesAsValue(u16, a[i .. i + 2]).*; | |
| if (ai != std.mem.bytesAsValue(u16, b[i .. i + 2]).*) { | |
| std.mem.writeInt(u16, diffs[j..], ai, endian); | |
| j += 2; | |
| diffs[j] = i; | |
| j += 1; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment