I'm working on some very basic card/array sorting functions for the Array object.
Cards are stored in an Array/Deck as strings, as I will be storing cards using their actual names. I need to count the number of cards in the deck whenever cards are added or removed, but I am having an issue.
If I run the following code:
// * On loop "Count"
// + StrAtX( "Deck", LoopIndex("Count") ) = ""
// Count : Add 1 to Counter
If I run this code:
* On loop "Count"
+ StrAtX( "Deck", LoopIndex("Count") ) = ""
Count : Destroy
The counter named "Count" gets destroyed
As you can see the conditions are identical. The MFA is attached. The lines in question are 13 and 14.
Z - Count Cards
+ - Add 1 to selected card index
- - Sub 1 from selected card index
Space - Remove card from current index and restack deck
Try removing one card then running the "Count" code with Z. You will see that nothing happens .