True, one of the main outcomes of having broken the codes were that we knew the attack on the Aleutians was a diversion to try and suck our forces there instead of to Midway, their objective was to capture Midway, not take out our carriers, they expected no carrier resistance from us. Fortunately our people were smart enough to figure that out and so we won the day, thanks to the brave crews who gave their lives and the the other crews who continued to fight even as they faced almost certain death.
The American fighting man of WWII had no equal.
Actually I think the whole idea of capturing Midway was to lure the American carriers into battle and destroy them. They actually succeeded in doing that.
But like the old saying goes, “sometimes you are the windshield and sometimes the bug”. this time they ended up being the bug.