# I need save values the list points and sum new values without sum id

**URL:** <https://discourse.processing.org/t/i-need-save-values-the-list-points-and-sum-new-values-without-sum-id/23334>\
**Category:** Coding Questions\
**Created:** [August 18, 2020, 2:27pm UTC](https://discourse.processing.org/t/i-need-save-values-the-list-points-and-sum-new-values-without-sum-id/23334 "2020-08-18T14:27:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Xremix31](https://avatars.discourse-cdn.com/v4/letter/x/ba8739/32.png) [@Xremix31](https://discourse.processing.org/u/Xremix31)\
**Post date:** [August 18, 2020, 2:27pm UTC](https://discourse.processing.org/t/i-need-save-values-the-list-points-and-sum-new-values-without-sum-id/23334/1 "2020-08-18T14:27:06Z")

</div>

Hi, I need save the last values for sum new values in points to show the cards in the same position the player. But i have a problem when try first time the position is correct and the same numbers of dices, but when try second time show other card because is lots the value of dice.  
the number {1:0} in list represent the id of player

I try this solution but not working.

let dice;  
let points = {1:0};

var x = Math.floor(Math.random() \* ((6 - 1) + 1) + 1);  
var y = Math.floor(Math.random() \* ((6 - 1) + 1) + 1);

dice = x+y;  
points = {1: dice};  
console.log(points, “teste de dados”);  
movePlayers(points);  
updatePlayers();  
createCards(points);  
updateRound();  
}

function createCards(points) {

let n= 0;  
let c = {1:n};

backImg = loadImage(’./assets/images/back.png’);  
for (let i = 0; i \< deckcards.length; i++){  
for (let j = 0; j \< points[i]; j++){  
console.log(points[i]);  
for (let k = 0; k \< c[i]; k++){  
image(cardsImg[c[i]], 310, 130, 250,350);  
[//console.log](https://console.log)(cardsImg[points[i]],“teste de casas”);  
n = n + points[i];  
}  
}  
}  
}

---

<div class="post-metadata">

**Author:** ![josephh](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/josephh/32/210_2.png) [@josephh](https://discourse.processing.org/u/josephh)\
**Post date:** [August 22, 2020, 9:15am UTC](https://discourse.processing.org/t/i-need-save-values-the-list-points-and-sum-new-values-without-sum-id/23334/2 "2020-08-22T09:15:24Z")

</div>

Hi,

First of all, please format your code by using the `</>` button in the message editor. (Tip : you can auto indent your code by pressing `Ctrl+T` in the Processing IDE)

> [@Xremix31](#):
>
> Hi, I need save the last values for sum new values in points to show the cards in the same position the player.

Could you be more precise? Try to explain your problem more clearly. Are you building a card game?  
Maybe a screenshot would also help 🙂

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [August 22, 2020, 10:27am UTC](https://discourse.processing.org/t/i-need-save-values-the-list-points-and-sum-new-values-without-sum-id/23334/3 "2020-08-22T10:27:42Z")

</div>

> [@Xremix31](#):
>
> backImg = loadImage(’./assets/images/back.png’);

Please don’t load this image here

Better load it in setup()
