This is my code. I want to make tic toc toe game I'm stuck at check value in cell. now I want to use for loop to check cell by cell. I don't know how to write it. Pls help me. TT
function onEdit(e) {
var activeSheet = e.source.getActiveSheet();
var cell = activeSheet.getRange("B2:D4");
var data = cell.getValues();
var data1 = data[2][2];
if(cell.getValues !== [["","",""],["","",""],["","",""]]){
Logger.log(cell.getValues());
Logger.log(data1)
for (var i = 2; i < 5; i++)
{
Logger.log("for1");
for (var j = 2; j < 5; j++)
{
Logger.log("for2");
if(data[i][j] == "X")
{
Logger.log("D")
activeSheet.getRange("H2").setValue("Playing");
}else
{
activeSheet.getRange("H2").setValues("");
Logger.log("F")
Logger.log(data1)
}
}
}
}
}