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

How to update a array to track wins, loss, ties

$
0
0
i know how to make an array but i cant figure out how to update it to track the wins and losses of a game
track_array = ["wins", "losses", "ties"]

thats my array i cant think of the code to keep track all i can think of is
if win 
"win" + 1 
elsif loss 
"loss" + 1
elsif tied
"ties" + 1
end 

or should i make 3 arrays like "win_array", "loss_array", "tie_array" and go that route
and thanks for any help that anyone givs

Viewing all articles
Browse latest Browse all 51036

Trending Articles



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