Here's the code I would use to do what you want:
set [# v] to [-999999] set [position v] to [1] set [count v] to [1] repeat (length of [list v]) if <(item (count) of [list v]) > (#)> set [# v] to (item (count) of [list v]) set [position v] to (count) end change [count v] by (1) end
Last edited by ErnieParke (2012-09-26 18:39:21)
Offline
Or this:
set [position v] to (1) set [counter v] to (1) repeat((length of [list v])-(1)) change [counter v] by (1) if<(item (counter) of [list v]) > (item (position) of [list v])> set [position v] to (counter) end end set [highest value v] to (item (position) of [list v])
Offline
MoreGamesNow wrote:
Or this:
set [position v] to (1) set [counter v] to (1) repeat(length of [list v]) if<(item (counter) of [list v]) > (item (position) of [list v])> set [position v] to (counter) end change [counter v] by (1) end set [highest value v] to (item (position) of [list v])
Your code could be simplified a bit, which I did above. Other than that, I had never thought of that.
Last edited by ErnieParke (2012-09-27 15:11:43)
Offline