Przeglądaj źródła

Document 'for' treatment of a bare number as a 'range()'

Dan Boorstein 6 lat temu
rodzic
commit
b4fb258356

+ 6 - 0
getting_started/scripting/gdscript/gdscript_basics.rst

@@ -842,6 +842,12 @@ in the loop variable.
     for c in "Hello":
         print(c) # Iterate through all characters in a String, print every letter on new line.
 
+    for i in 3:
+        statement # Similar to range(3)
+
+    for i in 2.2:
+        statement # Similar to range(ceil(2.2))
+
 match
 ^^^^^