# Variables

**URL:** <https://forum.kirupa.com/t/variables/329893>\
**Category:** Uncategorized\
**Created:** [November 2, 2012, 4:28pm UTC](https://forum.kirupa.com/t/variables/329893 "2012-11-02T16:28:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Modderov](https://avatars.discourse-cdn.com/v4/letter/m/d2c977/32.png) [@Modderov](https://forum.kirupa.com/u/Modderov)\
**Post date:** [November 2, 2012, 4:28pm UTC](https://forum.kirupa.com/t/variables/329893/1 "2012-11-02T16:28:11Z")

</div>

var P1cuori=0

function contapunti(a,b,c)  
{  
var i:int;  
for (i = 0; i \< 10; i++)  
{  
if (a.indexOf(b\*)!=-1)  
{   
if(i==0){c += 11}  
if(i==1){c += 10}  
if(i==2){c += 4}  
if(i==3){c += 3}  
if(i==4){c += 2}  
if(i==5){c += 0.5}  
if(i==6){c += 0.4}  
if(i==7){c += 0.3}  
if(i==8){c += 0.2}  
if(i==9){c += 0.1}  
trace (P1cuori)  
}  
}  
}

//CONTROLLO PUNTI DEI GIOCATORI

```
contapunti(Player1,cuori,P1cuori)

```

Hi all, i have this code… i dont understand why the value of the variable P1cuori remains to 0 while c value increases… any help?
