From 07175e60a03c375c32ac609a7ba9137b7ab91186 Mon Sep 17 00:00:00 2001 From: Max Date: Fri, 17 Mar 2023 18:08:51 -0500 Subject: [PATCH] Added info about range with negative step Added info about range with a negative step, because I have a lot of questions "how can I get a reversed range in GDScript?" in my local community. --- tutorials/scripting/gdscript/gdscript_basics.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tutorials/scripting/gdscript/gdscript_basics.rst b/tutorials/scripting/gdscript/gdscript_basics.rst index 0b0d3eb83..f942cbdd7 100644 --- a/tutorials/scripting/gdscript/gdscript_basics.rst +++ b/tutorials/scripting/gdscript/gdscript_basics.rst @@ -1137,6 +1137,9 @@ in the loop variable. for i in range(2, 8, 2): statement # Similar to [2, 4, 6] but does not allocate an array. + for i in range(8, 2, -2): + statement # Similar to [8, 6, 4] but does not allocate an array. + for c in "Hello": print(c) # Iterate through all characters in a String, print every letter on new line.