I am trying to do a randomize function. It randomly selects one person (from two) to insert something into the console. The second person goes next, and then they keep alternating until the loop ends.
randomize(); RandomTurn := random(2)+1; while (1) do begin if RandomTurn = 1 then PersonTurn((NumberOfMoves mod 2)+1) else PersonTurn(round(2/((NumberOfMoves mod 2)+1))); NumberOfMoves := NumberOfMoves + 1; end;
What do you think? How could this function be improved based on number of moves/user inputs?