Battleship issue

Okay, I'm creating a Battleship game. It's going to be using the console for now, still don't know GUI. Anyways, this is my issue. I have created two boards as lists, the first for the user, the second for the computer. I have the computer generate random numbers and a direction, and it places the ship there. I have put in several checkers, to ensure that they cannot be placed on top of each other, or go off the board. My issue, is that it seems to freeze, I would expect it to take a while, maybe no more than a minute, but it stays the same for 10 minutes, and then it crashes. Any help?

All right, so I've been staring at the code, and I've been thinking, is there some way to have it select numbers that aren't already selected? And that won't go out of bounds?
! I got it!
I'll try soem while: loops, and check back with you