Created
September 25, 2016 20:21
-
-
Save BoGuu/c552b652f752378f06a42c809150032e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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