Standardize all "Prints" comments in documentation

This commit is contained in:
Micky
2024-11-13 14:07:40 +01:00
parent 0f95e9f8e6
commit ca4b29b18d
19 changed files with 104 additions and 97 deletions

View File

@ -410,7 +410,7 @@
return number % 2 == 0
func _ready():
print([1, 3, 4, 7].find_custom(is_even.bind())) # prints 2
print([1, 3, 4, 7].find_custom(is_even.bind())) # Prints 2
[/gdscript]
[/codeblocks]
</description>
@ -637,10 +637,10 @@
If [method max] is not desirable, this method may also be used to implement a custom comparator:
[codeblock]
func _ready():
var arr = [Vector2(5, 0), Vector2(3, 4), Vector2(1, 2)]
var arr = [Vector2i(5, 0), Vector2i(3, 4), Vector2i(1, 2)]
var longest_vec = arr.reduce(func(max, vec): return vec if is_length_greater(vec, max) else max)
print(longest_vec) # Prints Vector2(3, 4).
print(longest_vec) # Prints (3, 4)
func is_length_greater(a, b):
return a.length() &gt; b.length()
@ -652,11 +652,11 @@
func _ready():
var arr = [1, 2, 3, 4, 5]
# Increment count if it's even, else leaves count the same.
# If the current element is even, increment count, otherwise leave count the same.
var even_count = arr.reduce(func(count, next): return count + 1 if is_even(next) else count, 0)
print(even_count) # Prints 2
[/codeblock]
See also [method map], [method filter], [method any] and [method all].
See also [method map], [method filter], [method any], and [method all].
</description>
</method>
<method name="remove_at">