I have the following code and am trying to make it shorter. I've tried using while and for loops but cannot make it work. I've also searched here at Stackoverflow and found enumerate and cycle loops, but keep on getting errors or generally don't know what I'm doing. Are there any ways to shorten this?
I'm sing python 3.2 with pygame-compatible version and idlex.
players = [npc1,npc2,npc3,human] # these are classes
# sets new order of players after being mixed
first_player = players[0]
second_player = players[1]
third_player = players[2]
fourth_player = players[3]
# sets players prey...goes one ahead in the index, wrap around at end
first_players_prey = players[1]
second_players_prey = players[2]
third_players_prey = players[3]
fourth_players_prey = players[0]
# sets players predator, goes back one in the index, wrap around
first_players_predator = players[3]
second_players_predator = players[0]
third_players_predator = players[1]
fourth_players_predator = players[2]
# sets players grand prey/predator while only 4 players, goes 2 ahead/back in index, wrap around
first_players_grand_prey_predator = players[2]
second_players_grand_prey_predator = players[3]
third_players_grand_prey_predator = players[0]
fourth_players_grand_prey_predator = players[1]