nikoli/nurikabe.html

70 lines
1.4 KiB
HTML
Raw Normal View History

2014-12-05 12:38:43 +01:00
<!DOCTYPE html>
<html>
<head>
<title>Nurikabe</title>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1.0, user-scalable=yes" />
<style>
body {
background-color: #aaa;
font-family: Verdana,Arial,sans-serif;
}
.game-container {
cursor: default;
font-weight: bold;
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.grid-cell {
background-color: #ddd;
width: 30px;
height: 30px;
display: inline-block;
margin: 1px;
padding: 5px;
border-radius: 3px;
text-align: center;
line-height: 30px;
font-size: 1.2em;
}
table {
border-collapse: collapse;
}
td {
border: 1px solid black;
height: 20px;
width: 20px;
text-align: center;
}
.white {
background-color: #fff;
}
.black {
background-color: #aaa;
}
</style>
<script type="text/javascript" src="nurikabe.js"></script>
<script type="text/javascript">
var nurikabe;
var game = JSON.parse("[[4,-1,-1,0,2],[0,-1,2,-1,-1],[0,-1,0,-1,3],[0,-1,-1,-1,0],[-1,-1,1,-1,0]]");
document.addEventListener("DOMContentLoaded", function() {
var board = document.getElementById('board');
nurikabe = new Nurikabe(board);
nurikabe.generate(game);
});
</script>
</head>
<body>
<h1>Nurikabe</h1>
<div id="board">
</div>
</body>
</html>