remove not used code

This commit is contained in:
Vaclav Tvrdik
2024-07-11 13:15:12 +02:00
parent 240d0bc213
commit da7f36539f
2 changed files with 1 additions and 37 deletions

21
ms.html
View File

@@ -19,11 +19,6 @@
</div> </div>
<div> <div>
<!-- VT commented out
<div style="margin: 10px 0px;">
F = Flagged, M = Mine, Left Click to reveal a cell, Right Click to flag a cell
</div> -->
<div class="status_msg"> <div class="status_msg">
<strong>Mines Remaining:</strong> <span id="mine_count"></span> <strong>Mines Remaining:</strong> <span id="mine_count"></span>
</div> </div>
@@ -39,22 +34,6 @@
</div> </div>
<div style="margin: 15px 0px;"> <div style="margin: 15px 0px;">
<!-- VT commented out
<div style="margin: 8px 0px;">
<label for="new_rows">Rows:</label>
<input type="number" id="new_rows" placeholder="rows" value="8" />
<label for="new_cols">Cols:</label>
<input type="number" id="new_cols" placeholder="cols" value="8" />
<label for="new_mines">Mines:</label>
<input type="number" id="new_mines" placeholder="mines" value="10" />
</div>
<div style="font-size: 10pt;">*max size: 19 x 19</div> -->
<input id="new_game_button" type="button" value="Create new game!" /> <input id="new_game_button" type="button" value="Create new game!" />
<input id="cheat_button" type="button" value="Cheat!" />
</div> </div>
<!-- VT commented out
<div>
<input id="cheat_button" type="button" value="Cheat!" />
<div style="font-size: 10pt;">*grid layout printed to JS console</div>
</div> -->
</div> </div>

17
ms.js
View File

@@ -162,12 +162,6 @@ class Minesweeper {
gameContainer.innerHTML = content; gameContainer.innerHTML = content;
//update input fields
// VT commented out
// document.getElementById("new_rows").value = this.options["rows"];
// document.getElementById("new_cols").value = this.options["cols"];
// document.getElementById("new_mines").value = this.options["mines"];
//setup status message //setup status message
document.getElementById("mine_count").textContent = document.getElementById("mine_count").textContent =
this.options["mines"] - (this.falseMines + this.minesFound); this.options["mines"] - (this.falseMines + this.minesFound);
@@ -320,6 +314,7 @@ class Cell {
//create a new game //create a new game
function newGame(opts = {}) { function newGame(opts = {}) {
game = new Minesweeper(opts); game = new Minesweeper(opts);
console.log(game.gridToString());
} }
window.onload = function () { window.onload = function () {
@@ -327,11 +322,6 @@ window.onload = function () {
document. document.
getElementById("new_game_button"). getElementById("new_game_button").
addEventListener("click", function () { addEventListener("click", function () {
// VT commented out
// const opts = {
// rows: parseInt(document.getElementById("new_rows").value, 10),
// cols: parseInt(document.getElementById("new_cols").value, 10),
// mines: parseInt(document.getElementById("new_mines").value, 10) };
const opts = { const opts = {
rows: 8, rows: 8,
cols: 8, cols: 8,
@@ -387,11 +377,6 @@ window.onload = function () {
} }
}); });
//attach click to cheat button
document.getElementById("cheat_button").addEventListener("click", function () {
console.log(game.gridToString());
});
//attach click to validate button //attach click to validate button
document. document.
getElementById("validate_button"). getElementById("validate_button").