How do I Fix this Recursion (Minimax Algorithm)

0 favourites
  • 2 posts
From the Asset Store
Finding the shortest path through the cells based on the A-star algorithm
  • I'm trying to build a board game 3x3 (like the last man standing) with AI. When I'm building the algoritm, there is a little problem with some condition. Like the image below.

    i just want to run "Terpilih = -1000" one time only, but its keep running and never done the "Else" events.

    For more detail check this

    [attachment=0:3r8hij83][/attachment:3r8hij83]

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Else events only triggered when the last event is NOT triggered, so if it always triggered the last event, of course the else event won't be triggered. Have you tried to look at the debugger and see if the Terpilih variable actually change value when you want it to change? Have you tried the "System > Trigger once while true" condition? (it supposed to make sure the event only triggered once, and only triggered again after the statement becomes false, because of a change of a variable's value for example)

    ps: fellow Indonesian here. (Ini buat tugas akhir ya? Eventnya sudah cukup rumit jadi susah bantu cari penyebab errornya kenapa, soalnya minim komentar di kodenya.)

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)