Several documentation improvements
This commit is contained in:
parent
c5f7a581f7
commit
a4c5790350
2 changed files with 26 additions and 49 deletions
|
@ -525,7 +525,7 @@
|
||||||
┠╴Menu
|
┠╴Menu
|
||||||
┃ ┠╴Label
|
┃ ┠╴Label
|
||||||
┃ ┖╴Camera2D
|
┃ ┖╴Camera2D
|
||||||
┖-SplashScreen
|
┖╴SplashScreen
|
||||||
┖╴Camera2D
|
┖╴Camera2D
|
||||||
[/codeblock]
|
[/codeblock]
|
||||||
</description>
|
</description>
|
||||||
|
|
|
@ -369,24 +369,19 @@
|
||||||
<description>
|
<description>
|
||||||
Returns the floating-point modulus of [code]a/b[/code] that wraps equally in positive and negative.
|
Returns the floating-point modulus of [code]a/b[/code] that wraps equally in positive and negative.
|
||||||
[codeblock]
|
[codeblock]
|
||||||
var i = -6
|
for i in 7:
|
||||||
while i < 5:
|
var x = 0.5 * i - 1.5
|
||||||
prints(i, fposmod(i, 3))
|
print("%4.1f %4.1f %4.1f" % [x, fmod(x, 1.5), fposmod(x, 1.5)])
|
||||||
i += 1
|
|
||||||
[/codeblock]
|
[/codeblock]
|
||||||
Produces:
|
Produces:
|
||||||
[codeblock]
|
[codeblock]
|
||||||
-6 0
|
-1.5 -0.0 0.0
|
||||||
-5 1
|
-1.0 -1.0 0.5
|
||||||
-4 2
|
-0.5 -0.5 1.0
|
||||||
-3 0
|
0.0 0.0 0.0
|
||||||
-2 1
|
0.5 0.5 0.5
|
||||||
-1 2
|
1.0 1.0 1.0
|
||||||
0 0
|
1.5 0.0 0.0
|
||||||
1 1
|
|
||||||
2 2
|
|
||||||
3 0
|
|
||||||
4 1
|
|
||||||
[/codeblock]
|
[/codeblock]
|
||||||
</description>
|
</description>
|
||||||
</method>
|
</method>
|
||||||
|
@ -771,24 +766,18 @@
|
||||||
<description>
|
<description>
|
||||||
Returns the integer modulus of [code]a/b[/code] that wraps equally in positive and negative.
|
Returns the integer modulus of [code]a/b[/code] that wraps equally in positive and negative.
|
||||||
[codeblock]
|
[codeblock]
|
||||||
var i = -6
|
for i in range(-3, 4):
|
||||||
while i < 5:
|
print("%2.0f %2.0f %2.0f" % [i, i % 3, posmod(i, 3)])
|
||||||
prints(i, posmod(i, 3))
|
|
||||||
i += 1
|
|
||||||
[/codeblock]
|
[/codeblock]
|
||||||
Produces:
|
Produces:
|
||||||
[codeblock]
|
[codeblock]
|
||||||
-6 0
|
-3 0 0
|
||||||
-5 1
|
-2 -2 1
|
||||||
-4 2
|
-1 -1 2
|
||||||
-3 0
|
0 0 0
|
||||||
-2 1
|
1 1 1
|
||||||
-1 2
|
2 2 2
|
||||||
0 0
|
3 0 0
|
||||||
1 1
|
|
||||||
2 2
|
|
||||||
3 0
|
|
||||||
4 1
|
|
||||||
[/codeblock]
|
[/codeblock]
|
||||||
</description>
|
</description>
|
||||||
</method>
|
</method>
|
||||||
|
@ -991,27 +980,15 @@
|
||||||
<description>
|
<description>
|
||||||
Returns an array with the given range. Range can be 1 argument N (0 to N-1), two arguments (initial, final-1) or three arguments (initial, final-1, increment).
|
Returns an array with the given range. Range can be 1 argument N (0 to N-1), two arguments (initial, final-1) or three arguments (initial, final-1, increment).
|
||||||
[codeblock]
|
[codeblock]
|
||||||
for i in range(4):
|
print(range(4))
|
||||||
print(i)
|
print(range(2, 5))
|
||||||
for i in range(2, 5):
|
print(range(0, 6, 2))
|
||||||
print(i)
|
|
||||||
for i in range(0, 6, 2):
|
|
||||||
print(i)
|
|
||||||
[/codeblock]
|
[/codeblock]
|
||||||
Output:
|
Output:
|
||||||
[codeblock]
|
[codeblock]
|
||||||
0
|
[0, 1, 2, 3]
|
||||||
1
|
[2, 3, 4]
|
||||||
2
|
[0, 2, 4]
|
||||||
3
|
|
||||||
|
|
||||||
2
|
|
||||||
3
|
|
||||||
4
|
|
||||||
|
|
||||||
0
|
|
||||||
2
|
|
||||||
4
|
|
||||||
[/codeblock]
|
[/codeblock]
|
||||||
</description>
|
</description>
|
||||||
</method>
|
</method>
|
||||||
|
|
Loading…
Reference in a new issue