Coding an Intelligent Battleship Agent

<p>Battleship seems to be a pretty popular format to test a variety of AI strategies. Online you can find a wide array of approaches, from reinforcement learning to genetic algorithms to Monte Carlo methods. One of the most viewed pieces of media on the topic is a&nbsp;<a href="https://www.youtube.com/watch?v=LbALFZoRrw8&amp;t=88s" rel="noopener ugc nofollow" target="_blank">Youtube video</a>&nbsp;by the channel Vsauce2. In the video, they describe a probability-based algorithm that leads to strategies far more sophisticated than a human player could reasonably use. That video led me to&nbsp;<a href="https://www.datagenetics.com/blog/december32011/" rel="noopener ugc nofollow" target="_blank">this blog post</a>&nbsp;by Nick Berry of DataGenetics, who describes the algorithm in great detail. His post begins with a relatively weak algorithm, but he builds it into a powerful solution that can dramatically outperform many other methods. His explanation of the algorithm is brilliant, but I was unable to find any source code for his implementation. I decided to recreate his strategies and to post the source code publicly for anyone who wants to play around with or modify it. For those who want it, everything is available at my&nbsp;<a href="https://github.com/aydinschwa/Battleship-AI/tree/main" rel="noopener ugc nofollow" target="_blank">Github</a>.</p> <p><a href="https://towardsdatascience.com/coding-an-intelligent-battleship-agent-bf0064a4b319"><strong>Click Here</strong></a></p>