Before we move on with the code, let's explain it in detail:
That's all for now.
Ok, now we're ready to move on.
Some explanation about the last part of the code.
- scelte is a list of the cards without briscole.
- pc1v takes the values of the cards (in the example there is only one card because there are 2 briscole, so there is no other card to compare, but it there were 2 or 3 cards the program would have chosen the smallest
As the values are not the same of the numbers, I had to pass the values of the cards in a list called pc1v.
So if the number is 1 the value is 11
if the number is 3 the value is 10
for 10 the value i 4, for 9 is 3, for 8 is 2
all the other cards value is 0,
but i will choose the smallest, because I want to get rid of the smallest... so I can' give 0 to all the other... I decided to subtract the value of 7 to the numbers so that 7 value is 0, 6 value is -1, 5 is -2. ecc.
That's all for now.
Comments
Post a Comment