Code: Select all
/**********************************************************************//**
Returns how many thousand citizen live in this city.
**************************************************************************/
int city_population(const struct city *pcity)
{
/* Sum_{i=1}^{n} i == n*(n+1)/2 */
return city_size_get(pcity) * (city_size_get(pcity) + 1) * 5;
}