Finding right variables and randomly choosing one of them
#2

If you are indexing arrays with numbers you are doing something wrong arrays are not really meant to be used like that unless you have good reason which would be very rare. Furthermore why are you using strings to identify items? That is a poor design choice these should all be integer values you would have something like this.

#define ITEM_TYPE_CHAIR 0
#define ITEM_TYPE_BOX 1

From my point of view the problem is all in the design it's flawed and those flaws manifest themselves later with either limitations, undefined behaviour, unneeded loops etc.
Reply


Messages In This Thread
Finding right variables and randomly choosing one of them - by Aa12 - 24.03.2016, 22:03
Re: Finding right variables and randomly choosing one of them - by Pottus - 24.03.2016, 22:08
Re: Finding right variables and randomly choosing one of them - by Aa12 - 24.03.2016, 22:23
Re: Finding right variables and randomly choosing one of them - by SickAttack - 24.03.2016, 23:51
Re: Finding right variables and randomly choosing one of them - by Aa12 - 25.03.2016, 07:42

Forum Jump:


Users browsing this thread: 2 Guest(s)