samedi 24 juillet 2021

How to restart a function when an if condition is met

How do I "restart" my function when an if condition is or isn't met.
In this pseudocode, if the if condition is met, I would like to stop what the function was doing and restart again.

function example()

     .
     .
     .

 for i in 1:N
        for j in 1:N
            if Mat[i,j] > 1
                Mat[i,j] += restart? # Here the process should restart,
            end
        end
    end

Aucun commentaire:

Enregistrer un commentaire