From 5ab481344f46e239fd7ab6b694e53c65876cc778 Mon Sep 17 00:00:00 2001 From: Gnieark Date: Sat, 28 May 2016 15:03:50 +0200 Subject: [PATCH] logs --- html/testBot.html | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/html/testBot.html b/html/testBot.html index b3f1609..65eef3d 100644 --- a/html/testBot.html +++ b/html/testBot.html @@ -56,7 +56,11 @@ function createElem(type,attributes){ {elem.setAttribute(i,attributes[i]);} return elem; } - +function addLog(message){ + var p=createElem('p'); + p.innerHTML=message; + document.getElementById('logs').appendChild(p); +} function changePlayerType(player,newValue){ if(newValue == "bot"){ document.getElementById('url' + player).disabled=""; @@ -81,7 +85,7 @@ function playingAT(col){ } grid[i][col]=symbol; document.getElementById('td' + col + '_' + i).innerHTML = symbol; - + addLog('player ' + currentPlayer + ', symbol ' + symbol + 'played col ' + col); //change player if(currentPlayer == 1){ play(2);