我有一个数组设置,它包含一个tic tac toe board和console.log()的数字,然后显示在一个函数中。
我需要做到这一点,一旦获得胜利线,一条消息将出现说赢家或其他什么。
这是我的
var boardsq = ["1","2","3","4","5","6","7","8","9"];
function boardDisplay() {
console.log("| "+boardsq[0]+" | "+boardsq[1]+" | "+boardsq[2]+" |");
console.log("| "+boardsq[3]+" | "+boardsq[4]+" | "+boardsq[5]+" |");
console.log("| "+boardsq[6]+" | "+boardsq[7]+" | "+boardsq[8]+" |");
}
我是否正确地说我需要&&和||运营商