Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

multidimensional array if statement problem

$
0
0
hi all basically i have to randomise an array of playing cards(with 4 suits) so i get two random numbers within my ranges and i need to see if both array values are same as the random numbers

here is my code
if (shuffledcardsuit[x, y] == FNum, SNum)




im trying to do an if statement for basically if the x element is the same as FNum and then the y element same as SNum

i have skipped this and made a normal array and made the game without the suits but now i got the game working how i want it i have come back to add in the suits of cards and im only seeing a possible way of doing this by having multidimensional array [0-8, 0-3] where the second set of values are for example
0=red square
1= red circle
2=black square
3=black circle

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>