Skip to content

Commit 910aa72

Browse files
committed
Adding an array function map. Minor wording edits. Updating license year.
1 parent 1daf11e commit 910aa72

File tree

4 files changed

+4
-3
lines changed

4 files changed

+4
-3
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2020 Adam Rumpf
3+
Copyright (c) 2021 Adam Rumpf
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ A variety of scripts dealing with sequences, functions, and sets, which may have
2222
Common array functions (such as searching and counting).
2323

2424
* [`_array_count`](https://github.com/adam-rumpf/game-maker-scripts/blob/master/scripts/_array_count/_array_count.gml): Counts the number of occurrences of a specified value in an array.
25+
* [`_array_function`](https://github.com/adam-rumpf/game-maker-scripts/blob/master/scripts/_array_function/_array_function.gml): Applies a given function to every element of a given array, and returns an array of results.
2526
* [`_array_index`](https://github.com/adam-rumpf/game-maker-scripts/blob/master/scripts/_array_index/_array_index.gml): Finds the first index at which a specified value occurs in an array (or -1 if not found). An optional argument allows the search to begin from a specified index.
2627
* [`_array_max`](https://github.com/adam-rumpf/game-maker-scripts/blob/master/scripts/_array_max/_array_max.gml): Returns the maximum value (or the index of the maximum value) in an array.
2728
* [`_array_min`](https://github.com/adam-rumpf/game-maker-scripts/blob/master/scripts/_array_min/_array_min.gml): Returns the minimum value (or the index of the minimum value) in an array.

scripts/_random_weighted_index/_random_weighted_index.gml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function _random_weighted_index(wt)
2323

2424
// Find which interval this number belongs to
2525
var i = 0;
26-
while (r > 0 && i < n)
26+
while ((r > 0) && (i < n))
2727
{
2828
r -= wt[i];
2929
i++;

scripts/_range/_range.gml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/// @func _range(start, stop[, step]])
1+
/// @func _range(start, stop[, step])
22
/// @desc Generates an array of equally-spaced values over a specified range with a specified step size.
33
/// @param {real} start First value of array.
44
/// @param {real} stop Final value of array (if the step size evenly divides the array; otherwise gives an upper bound to the final value).

0 commit comments

Comments
 (0)