simple vector scrolling..
yeah i was wondering if you could help me with a simple algorithm im missing.
I have some player scores I want to show in a game, and i have them stored in a vector. What i want to do is show 10 scores at a time on screen, then have a "next line" and "prev line" button to scroll through the scores.
a basic idea ive been thinking about is make a 10-element vector and store the elements i want to display from the bigger vector onto that one. this is what i got so far:
where len = players.size() and cursor is initialized to 0 (on its first run).
cursor = (cursor+1)%len;
if(cursor <= 0)
cursor = (cursor-1)% len;
vector<Player> Stats::current_stats(const vector<Player>& players)
for (int i=0; i<temp2.size(); i++)
thanks in advace : ]