If it's just a search through a little if-else block each move, then it's linear time complexity, as well! Fastest (yet most impossible) chess AI, perhaps?
If the AI was simply a preprogrammed response to each possible board state, it wouldn't need to do any work at all to calculate. When the player enters a move, it's at most 139 if-else branches (the highest possible number of available moves in a chess position) to determine how to move the white piece, and the black movement would be preprogrammed as part of that method. That's even faster than linear time. Constant time, perhaps.
14
u/JonIsPatented Apr 10 '23
If it's just a search through a little if-else block each move, then it's linear time complexity, as well! Fastest (yet most impossible) chess AI, perhaps?