I'm pretty new to Mathematica (and functional programming in general). I'm working on some code to find winners (maximal values) in a list. The code I have that is hanging is this line.
For[i = 1, 1 <= Length[WinnerList] + 1, i++,
If[WinnerList[[i]] == winner, AppendTo[WinnerIndexList, i],]]
Basically, my code goes through a list, and adds the index i
from that list to a second list, if the i-th entry is a 'winner'. My code hangs, but I get the correct output if I abort my code. Any ideas?