I am implementing an AI system that basically plays the Battle Ships game. A part of this AI consists in placing the Ships on the board. This should be a random process but however statistics says that you are more likely to win the game if you place your ships near to the edge of the board.
So, saying the ship can be at any position X (between 0 and 9) and Y (between 0 and 9) I would like to implement an algorithm that can generate a random integer between 0 and 9 with more probability of returning numbers closer to 0 or closer to 9 (being 4 and 5 the numbers less likely to be returned). This would be a javascript algorithm but any intuition using pseudo-code is appreciated.
Any suggestions?
Thanks!
