Skip to content

Commit

Permalink
Update script.js
Browse files Browse the repository at this point in the history
  • Loading branch information
spbRusty authored Aug 26, 2024
1 parent f730419 commit 40b7050
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions script.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
window.Telegram.WebApp.ready();

function showError(message) {
const errorModal = document.createElement('div');
errorModal.className = 'error-modal';
Expand All @@ -15,11 +13,11 @@ function showError(message) {
}

function callDonat() {
if (window.Telegram && window.Telegram.WebApp) {
window.Telegram.WebApp.sendData('/help');
} else {
showError('Telegram Web App API не доступен');
}
//if (window.Telegram && window.Telegram.WebApp) {
Telegram.WebApp.sendData('/help');
//} else {
// showError('Telegram Web App API не доступен');
//}
}

let playerScore = 0;
Expand Down Expand Up @@ -50,7 +48,7 @@ function determineWinner(playerChoice, computerChoice) {

function updateScoreboard() {
const scoreboard = document.getElementById('result-message');
scoreboard.innerHTML = `Счёт11:<br>Вы - ${playerScore}, Компьютер - ${computerScore}<br>Раунд ${roundsPlayed + 1}`;
scoreboard.innerHTML = `Счёт12:<br>Вы - ${playerScore}, Компьютер - ${computerScore}<br>Раунд ${roundsPlayed + 1}`;
}

function checkGameWinner() {
Expand Down

0 comments on commit 40b7050

Please sign in to comment.