Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
EchtkPvL-bot committed Feb 1, 2024
1 parent 2a1b20b commit eb84b05
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
11 changes: 6 additions & 5 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
</head>

<body>
<div class="window" style="width: 237px">
<div class="window" style="width: 255px">
<div class="title-bar">
<div class="title-bar-text">TWITCHSWEEPER</div>
<div class="title-bar-controls title-bar-controls-right">
Expand All @@ -40,7 +40,7 @@
</table>
</div>
<div class="status-bar">
<p class="status-bar-field">x-y in chat to play</p>
<p class="status-bar-field">xy in chat to play (e.g. B3)</p>
<p class="status-bar-field" id="status">Slide 1</p>
<p class="status-bar-field">wip</p>
</div>
Expand Down Expand Up @@ -87,9 +87,10 @@
console.log("MSG: " + msg + " from " + parsed.username);

// magic
if (/^\d+-\d+$/.test(msg)) {
let x = msg.split('-')[0] - 1;
let y = msg.split('-')[1] - 1;
if (/^\w\d{1,2}$/.test(msg)) {
let x = msg.substring(1) - 1;
let y = msg.split('-')[0];
y = y.toLowerCase().charCodeAt(0) - 97;
game.turn(x, y);
}

Expand Down
7 changes: 7 additions & 0 deletions main.css
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ td span {
margin: 0 auto;
}

td:first-child {
border: 0 !important;
width: 12px !important;
min-width: 12px !important;
max-width: 12px !important;
}

[class^="ts-a-"]>span,
[class^="ts-z-10"]>span,
[class^="ts-z-19"]>span,
Expand Down
7 changes: 5 additions & 2 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ class TwitchSweeper {

// Expert
case 2:
this.x = 30;
this.y = 16;
this.x = 16;
this.y = 30;
this.mines = 99;
break;

Expand Down Expand Up @@ -113,6 +113,9 @@ class TwitchSweeper {

for (let j = 0; j < this.x; j++) {
var tr = document.createElement('tr');
var td = document.createElement('td');
td.appendChild(document.createTextNode(String.fromCharCode(j + 'A'.charCodeAt(0))));
tr.appendChild(td);
// loop the inner array
for (let i = 0; i < this.y; i++) {
var d = this.savedata[i][j];
Expand Down

0 comments on commit eb84b05

Please sign in to comment.