Skip to content

Instantly share code, notes, and snippets.

class Node {
constructor(state, node) {
if (arguments.length === 1) {
this.state = state;
this.parent;
this.childArray = [];
} else if (arguments.length === 2) {
this.state = new State(null, node.state);
if (node.parent !== (null || undefined)) {
this.parent = node.parent;
@pengcheng95
pengcheng95 / Node.js
Last active January 16, 2018 05:24
MCTS Tic Tac Toe
class Node {
constructor(state, node) {
if (arguments.length === 1) {
this.state = state;
this.parent;
this.childArray = [];
} else if (arguments.length === 2) {
this.state = new State(null, node.state);
if (node.parent !== (null || undefined)) {
this.parent = node.parent;
<!DOCTYPE html>
<html>
<head>
<title>n-queens solver</title>
</head>
<body>
<script type="src/queenWorker.js"></script>
<script>