Skip to content

stack overflow when the A.I has no available moves Β #33

@HermesPasser

Description

@HermesPasser

πŸ‘€
Cortesia de @BrunoVRoger

==β™•=====
========
========
=β™”======
========
========
========
  
File "/home/bcr/Documentos/personal/chessia/ui/worker.py", line 42, in run_ai
    from_pos, to = self.game.play_turn_ia_start()
  File "/home/bcr/Documentos/personal/chessia/engine/game.py", line 305, in play_turn_ia_start
    _, ai_move = ai.calc_best_move(self.ai_difficulty, self, Color.BLACK)
  File "/home/bcr/Documentos/personal/chessia/engine/ai.py", line 72, in calc_best_move
    value = calc_best_move(depth - 1, game, player_color, alpha, beta, not is_maximizing_player)[0]
  File "/home/bcr/Documentos/personal/chessia/engine/ai.py", line 94, in calc_best_move
    return [best_move_value, best_move or possible_moves[0]]
IndexError: list index out of range

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions