Quantcast
Channel: Answers for "An array of bools with random true and false elements"
Browsing all 4 articles
Browse latest View live

Answer by Bunny83

Sure, don't use an array at all. It makes no sense in this case. Just use a single integer variable to specify which statement you want to execute: int selection = 0; // [...] if (selected == 0) { //...

View Article



Answer by Owen Reynolds

Since you write it's for a real school course, you may as change the if into a lookup (too confusing for many programmer/artists, but in school you'll learn it anyway): public Color[] EnemyCols; // set...

View Article

Answer by Bunny83

Sure, don't use an array at all. It makes no sense in this case. Just use a single integer variable to specify which statement you want to execute: int selection = 0; // [...] if (selected == 0) { //...

View Article

Answer by Owen-Reynolds

Since you write it's for a real school course, you may as change the if into a lookup (too confusing for many programmer/artists, but in school you'll learn it anyway): public Color[] EnemyCols; // set...

View Article
Browsing all 4 articles
Browse latest View live




Latest Images

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