diff options
author | Boris Verkhovskiy <boris.verk@gmail.com> | 2024-04-03 04:31:13 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-03 04:31:13 -0700 |
commit | fbf132752b743d0f43c3395da0699bee53da22df (patch) | |
tree | 56da43c86e1aebd24e3913b405e21d6f2812e9a3 /gdscript.html.markdown | |
parent | 247dc6e86c1421fa031e4b61c42c05ca6e09bfb0 (diff) | |
parent | c166f2acb295627c5ae305a6dd517a27ca8fece6 (diff) |
Merge branch 'master' into patch-1
Diffstat (limited to 'gdscript.html.markdown')
-rw-r--r-- | gdscript.html.markdown | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gdscript.html.markdown b/gdscript.html.markdown index 25af0974..0bfac26a 100644 --- a/gdscript.html.markdown +++ b/gdscript.html.markdown @@ -95,7 +95,7 @@ func doing_math(): func control_flow(): x = 8 y = 2 # y was originally a float, - # but we can change it's type to int + # but we can change its type to int # using the power of dynamic typing! if x < y: @@ -114,6 +114,9 @@ func control_flow(): for i in range(20): # GDScript's range is similar to Python's print(i) # so this will print numbers from 0 to 19 + for i in 20: # unlike Python, you can loop over an int directly + print(i) # so this will also print numbers from 0 to 19 + for i in ["two", 3, 1.0]: # iterating over an array print(i) @@ -319,4 +322,4 @@ signal example(arg: int) # ERROR! Signals can't take typed arguments! * [NodePath](https://docs.godotengine.org/en/stable/classes/class_nodepath.html) * [Signals](https://docs.godotengine.org/en/stable/getting_started/step_by_step/signals.html) * [GDQuest](https://www.gdquest.com/) -* [GDScript.com](https://gdscript.com/)
\ No newline at end of file +* [GDScript.com](https://gdscript.com/) |