Skip to content

Commit d75d905

Browse files
committed
Working part two!
Needed to make sure and clone the `last_nat`, otherwise bad things happened.
1 parent 0a2eff9 commit d75d905

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

2019/23/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
| Part 1 | Part 2 |
44
|----------|---------|
5-
| `22659` | ` ` |
5+
| `22659` | `17429` |
66

77
## --- Day 23: Category Six ---
88

2019/23/network.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ class Network {
9393
return { x: nat_packet[0], y: nat_packet[1] };
9494
}
9595

96-
// @todo Reset NAT packet here?, e.g. `nat_packet = undefined`?
97-
last_nat_sent = nat_packet;
96+
// Clone the packet, otherwise, when NIC 0 consumes this packet it modifies this value
97+
last_nat_sent = [...nat_packet];
9898
idle = IDLE_REST;
9999
}
100100
}

0 commit comments

Comments
 (0)