visited states with board encode