# Thread: a point in the right direction

1. ## a point in the right direction

Hi all,

I am making a basic football managment game and i am struggling to store values in the league table, heres what i have so far.

its not the whole program just the part where i need to add up values.

Code:
```if (team1 > team2)        // if team 1 wins
{

wont1++;
gfort1[1] = + team1;
ggainst1[1] = + team2;
pointst1 = + 3;
}

if (team2 > team1)         // if team 2 wins
{
wont2++;
gfort2[1] = + team2;
ggainst2[1] = + team1;
pointst2 = + 3;
}

if (team1 == team2)            // if a draw
{
gfort1[1] + team1;
ggainst1[1] + team2;
gfort2[1] + team2;
ggainst2[1] + team1;
pointst1 = + 1;
pointst2 = + 1;
}```
The variables team 1 & 2 are random numbers.

This might be absolute crap, but what i want to do is everytime team 1 or 2 wins i want to add 3 to their points or 1 point if they draw.

Also gfor1 & 2 need to store values for goals scored
And ggainst1 & 2 need to store values for goals against

Cheers guys

&#91;code]&#91;/code]tagged by Salem

2. First, change pointst1 = + 3; to pointst1 += 3; (and all others that does the same).

Second, gfort1[1] + team1; calculates the sum, but doesn't do anything with it. If you want to add team1 to gfort[1], then change + to +=.

3. Thanks for that mate..

Just got one more problem

i have 6 variables that store points

i need to sort them by number order highest at the top
lowest at the bottem......

any ideas?

4. Use the search function at the top of the page and look for "bubblesort"
It's a sorting algorithm if you're wondering.