you have to change it, it isnt constant.
xp is changed in one place, this if statement:
else if(r == y && r == y2 && c == x && c == x2)
what are the value of r, y, y2, c, x, and x2 when you think xp should change?
the logic must not be correct, if it is not going into the condition. Did you really mean y == y2 and x == x2, you know these are the same?
I get a little heart moving around in your dots if I change those to ors, but its probably wrong, the grid gets borked up. XP changed, though.
I'm not sure what is being attempted but its possible that y2 could potentially equal 20 and x2 could possibly equal 15 which in both cases its not possible for r or c to be equal to the respective counterparts.
Also the odds are definitely stacked against you to have x==x2 and y==y2 especially at the same time. Im not going to try and calculate the odds but I'd guess less than a 1% chance.
Id suggest putting the number roll inside of the while loop to increase the odds. Also its kinda pointless to reseed rand every roll.