[Include] Numeric combinations.
#7

rBits looks good I've never tested/used that system so I can't tell you something more!

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
The idea is good. I'd probably use something like this:
pawn Код:
// SetCombination:
comb[9 - slot] = (1 <= value <= 9) ? 48 + value : 48;

// GetCombination:
if (48 <= (slot = comb[9 - slot]) <= 57) return slot - 48;
instead of those switch statements though.
Do you mean do something like this?
PHP код:
stock SetCombination(&var, slotvalue)
{
    new 
comb[11];
    
format(comb11"%010i", var);
    
comb[slot] = (<= value <= 9) ? 48 value 48;
    return -
1;
}
stock GetCombination(var, slot)
{
    new 
comb[11];
    
format(comb11"%010i", var);
    if(
48 <= (slot comb[slot]) <= 57) return slot 48;
    return 
0;

It's great but always return 0 for me, I don't know if I'm doing it well :P
Reply


Messages In This Thread
Numeric combinations. - by Swedky - 10.12.2016, 16:03
Re: Numeric combinations. - by SsHady - 10.12.2016, 16:17
Re: Numeric combinations. - by Jayse - 10.12.2016, 16:41
Re: Numeric combinations. - by Crayder - 10.12.2016, 16:48
Re: Numeric combinations. - by AbyssMorgan - 10.12.2016, 16:51
Re: Numeric combinations. - by Konstantinos - 10.12.2016, 17:00
Re: Numeric combinations. - by Swedky - 10.12.2016, 17:44
Re: Numeric combinations. - by RIDE2DAY - 10.12.2016, 18:56
Re: Numeric combinations. - by Swedky - 10.12.2016, 20:39
Re: Numeric combinations. - by Konstantinos - 10.12.2016, 21:17

Forum Jump:


Users browsing this thread: 1 Guest(s)