Skip to content

Instantly share code, notes, and snippets.

View sharikovvladislav's full-sized avatar
🎯
Focusing

Sharikov Vladislav sharikovvladislav

🎯
Focusing
View GitHub Profile
function alphabeta(node, depth, alpha, beta, isMax, g) {
g.nodes[node.name].shape.items['0'].attr('fill', 'green');
if((depth == 0) || (node.isTerminal == true)) {
return node.value;
}
if(isMax) {
console.log('maximizing');
for (var i in node.children) {
var child = node.children[i];
function alphabeta(node, depth, alpha, beta, isMax, g) {
g.nodes[node.name].shape.items['0'].attr('fill', 'green');
if((depth == 0) || (node.isTerminal == true)) {
return node.value;
}
if(isMax) {
console.log('maximizing');
for (var i in node.children) {
var child = node.children[i];
function alphabeta(node, depth, alpha, beta, isMax, g) {
g.nodes[node.name].shape.items['0'].attr('fill', 'green');
if((depth == 0) || (node.isTerminal == true)) {
return node.value;
}
if(isMax) {
console.log('maximizing');
for (var i in node.children) {
var child = node.children[i];