Building on yesterday's randomly-placed single squares, today I figured out how to randomly place battleships of various sizes on my grid! Now I can prevent them from overlapping, too! Not sure if I did it "right", but it seems to be working. This StackOverflow thread was really helpful.
And apparently I made a recursive function. Don't think I've ever done that before!