The scene in ST II from the Reliant's attack to Enterprise's counter-attack is awesome.
Among other things it's nice to see the Enterprise's various bridge operations -- Kirk and Spock first check the damage control panel, then Spock goes to his computer station to get the code, then he goes to the weapons to lower Reliant's shields -- it's not random at all.
But is funny how the code can't have repeated numbers: the buttons (more like switches) don't come back after pressed, see:
Yeah. I'd think that Starfleet computers would easily be able to force their way through it. Even if the other vessel only allows for one attempt, that's pretty unsafe.
But it's an awesome scene.
That Spock assumed Khan could not only know of the code but be able to reprogram it speaks to his respect for Khan's intellect. He follows up his suggestion that Khan changed the code by saying, "He's quite intelligent."
Yeah. Maybe Khan read the manuals, but they probably don't mention that little bit.