Skip to content
This repository has been archived by the owner on Apr 10, 2024. It is now read-only.

Commit

Permalink
dev last 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
givename committed Aug 11, 2021
1 parent 84bb229 commit 0fcddb1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
4 changes: 2 additions & 2 deletions notes/apiNote2_Style/apiNote2_Style.txt
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,9 @@

- <Function Declaration> используются только файлах скриптов на самом верхнем уровне,
- в иных случаях должны использоватся методы <Function Expression>
-

- <Function Declaration> гарантирует, что функция инициализированна до момента исполнения основного кода
-

- однако объявление функция в стиле <Function Declaration> в объекта (а так же некоторых других ситуациях),
- является обычным <Function Expression> (по крайней мере в версии 2.3.3)

Expand Down
8 changes: 8 additions & 0 deletions scripts/apiScrArray/apiScrArray.gml
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,14 @@ if (API_TEST_ENABLE) {
"<apiArrUnshift 1>"
);

apiDebugAssert(
array_equals(
_f(_array, apiArrUnshift(_array)),
[7, 0, 88, 8, 9, 1, 2, 3, 4, 5]
),
"<apiArrUnshift 2>"
);

show_debug_message("\t apiArrUnshift \t\tis work");

#endregion
Expand Down
4 changes: 2 additions & 2 deletions scripts/apiScrArrayHigher/apiScrArrayHigher.gml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/// @function apiArrMap(array, f, [data]);
function apiArrMap(_array, _f, _data) {
var _size = array_length(_array);
for (var _i = 0; _i < _size; _i += 1)
for (var _i = 0; _i < _size; ++_i)
array_set(_array, _i, _f(_array[_i], _i, _data));
}

Expand Down Expand Up @@ -46,7 +46,7 @@ function apiArrBulMap(_array, _f, _data) {
var _size = array_length(_array);
var _arrayBul = array_create(_size);

for (var _i = 0; _i < _size; _i += 1)
for (var _i = 0; _i < _size; ++_i)
array_set(_arrayBul, _i, _f(_array[_i], _i, _data));

return _arrayBul;
Expand Down

0 comments on commit 0fcddb1

Please sign in to comment.