Hi! I'm attempting to make a card game in App Inventor, and I need to shuffle cards. It's supposed to pick a random card, save the card and index of the card, then if the card selection is currently in the unshuffled deck (basedeck) it adds the selected card to a different list and removes it from basedeck, essentially moving it. I set up a Label component to show the result to confirm it works, yet it only shows 1 card. I checked and it does shuffle, but doesn't show the other 51 cards in the Label. I've attached both the code for the shuffle and the code for the Label, can someone check what the problem is? Thanks!
which is the content and where are you setting "global temp"? (are you comparing it with an empty string or with a blank?)
Because if with the last item of shuffleddeck, the check "global temp" = "" is true, then you will see only that last item in the label. In that if you are not joining the current label.Text with the new item.
However, here you are not joining label.text with the item you are removing. Here you are assigning only the item removed in each iteration so, only the last item removed is displayed:
I see! I fixed it by adding a join block in the first if/then statement between the set Label1.Text block and the select list item block as shown here.
Thanks!