07.12.2011, 14:54
kinda made up a scenario in my head about a dynamic string based on some variables, personally I'd just use another string but I came up with this script if I had to use the same string.
result:
0101010101
23232
not sure if it'd be faster than making all the cells null
pawn Код:
new x[16];
for(new i;i<10;i++)
{
switch(i)
{
case 1, 3, 5, 7, 9: x[i] = '1';
default: x[i] = '0';
}
}
print(x);
x[0] = '\0';
for(new i;i<5;i++)
{
switch(i)
{
case 1, 3, 5, 7, 9: strins(x,"3",i,sizeof(x));
default: strins(x,"2",i,sizeof(x));
}
}
print(x);
0101010101
23232
not sure if it'd be faster than making all the cells null