Skip to content

Instantly share code, notes, and snippets.

@BoGuu
Created September 25, 2016 20:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BoGuu/c552b652f752378f06a42c809150032e to your computer and use it in GitHub Desktop.
Save BoGuu/c552b652f752378f06a42c809150032e to your computer and use it in GitHub Desktop.
params[["_array","",[""]]];
if (_array isEqualTo "") exitWith {[]};
_array = toArray(_array);
private _indexes = [];
private _p = 0;
for "_i" from 0 to (count _array)-1 do {
_sel = _array select _i;
if (_sel == 96) then
{
_array set[_i,39];
if (!(_p isEqualTo 2) && {_array select (_i - 1) isEqualTo 39}) then {
_indexes pushBack _i;
_p = _p + 1;
} else {
if (_p isEqualTo 2) then {_p = 0;};
};
};
};
if !(_indexes isEqualTo []) then {
private _y = 0;
{
_array deleteAt (_x - _y);
_y = _y + 1;
false
} count _indexes;
};
_array = toString(_array);
_array = call compile format["%1", _array];
_array;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment