Hi, I am writing a minmax code for a game, but whenever I run it I get the error Invalid set index 'start' (on base: 'Node (main.gd)') with value of type 'bool'. What does it mean and how do I fix it.
extends Node
var board=[7,5,3,1]
func _ready():
self.board=board
self.start=true
makechilds(self)
func makechilds(pnode):
for x in range(0,4):
board=pnode.board
for y in range (0,pnode.board[x]):
board[x]-=1
var child=Node
child.board=board
child.done=false
child.start=false
pnode.done=true
nextsubject(pnode)
func nextsubject(pnode):
for i in range (0,pnode.get_child_count( )):
if not pnode.get_child(i).board==[0,0,0,0] and pnode.get_child(i).done==false:
makechilds(pnode.get_child(i))
if pnode.start==false:
nextsubject(pnode.get_parent())
else:
print('done')