var chessgame = new chessgame(); chessgame.onkeycodeinput((keycode) => { if(keycode.isvalid()) { chessgame.commenceagain(); chessboard.exclude('pawns'); for(var piece in chessboard.pieces) { if(piece.designs.preceding(keycode)) { console.log($"{piece.name} is ready for the next move."); } } } else { console.log("invalid keycode. please try again."); } });