carbocarde / battleship Goto Github PK
View Code? Open in Web Editor NEWLicense: GNU General Public License v3.0
License: GNU General Public License v3.0
Hi,
Thanks for nice blog write up on problem I was trying to solve some months ago.
As for solver:
Line 28 in 35556fc
What solver tries to achieve is to create heat map of probability that part of the ship occupies the spot. There are two approaches here:
Lets take a example:
3x3 board, available ships 1x3size + 2x1size, board initial conditions:
0 0 0
0 0 0
0 0 0
4 4 4
4 4 4
4 4 4
4 1 4
1 0 1
4 1 4
From probability side, improved heat-map is more precise when we reduce available space in board (either by sinking ships or by miss shots) ,also as it is heavy in calculating permutations, should be done on reduced ship size and board size - thus during mid-to-end game.
I was not able to create performant solution of such solver, I will leave that challenge to you ;)
Keep it up!
The following behavior has been seen when toggling squares between hit or miss:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.