import malebolgia, malebolgia / ticketlocks
    
    proc move*(hypothetical:Hypothetic,dice:openArray[int]):Move =
      var flowMoves = initTicketLock[seq[Move]]()
      var m = createMaster()
      m.awaitAll:
        for pieceNr,fromSquare in hypothetical.pieces:
          if fromSquare != 0 or hypothetical.cash >= piecePrice:
            for die in dice:
              m.spawn hypothetical.bestMove(pieceNr, fromSquare, die, flowMoves)
      unprotected flowMoves as fm:
        fm.sortedByIt(it.eval)[^1]
    
    
    
    Run

It's not so bad, is it.

Reply via email to