Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // list.cfg by |FOX|Yarukinasu
- listadd = [ result (concat $arg1 $arg2) ]
- listinsert = [
- len = (listlen $arg1)
- if (|| [ > $arg2 $len ] [ < $arg2 ]) [
- echo "Index must be greater than or equal to zero and less than or equal to the length" ] [
- tmplist = ""
- loop i $arg2 [ tmplist = (concat $tmplist (at $arg1 $i)) ]
- tmplist = (concat $tmplist $arg3)
- loop i (- $len $arg2) [ tmplist = (concat $tmplist (at $arg1 (+ $i $arg2))) ]
- result (trim $tmplist) ] ]
- listremove = [
- if (|| [ >= $arg2 (listlen $arg1) ] [ < $arg2 ]) [
- echo "Index must be greater than or equal to zero and less than the length" ] [
- result (listreplace $arg1 $arg2) ] ]
- listreplace = [
- len = (listlen $arg1)
- if (|| [ >= $arg2 $len ] [ < $arg2 ]) [
- echo "Index must be greater than or equal to zero and less than the length" ] [
- tmplist = ""
- loop i $arg2 [ tmplist = (concat $tmplist (at $arg1 $i)) ]
- tmplist = (concat $tmplist $arg3)
- loop i (- (- $len $arg2) 1) [ tmplist = (concat $tmplist (at $arg1 (+ (+ $i $arg2) 1))) ]
- result (trim $tmplist) ] ]
- listreverse = [
- len = (listlen $arg1)
- tmplist = ""
- loop i $len [ tmplist = (concat $tmplist (at $arg1 (- (+ (* $i -1) $len) 1))) ]
- result (trim $tmplist) ]
- trim = [
- len = (listlen $arg1)
- if $len [
- tmplist = (at $arg1)
- loop i (- (listlen $arg1) 1) [ tmplist = (concat $tmplist (at $arg1 (+ $i 1))) ]
- result $tmplist ] [ result ] ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement