Переглянути джерело

Change square brackets to parentheses

Minor change to avoid unnecessary confusion by conditional statements not executing properly if a beginner programmer uses square brackets rather than parentheses to enclose a condition.
bearbybits 3 роки тому
батько
коміт
d7bbff839f
1 змінених файлів з 3 додано та 3 видалено
  1. 3 3
      tutorials/scripting/gdscript/gdscript_basics.rst

+ 3 - 3
tutorials/scripting/gdscript/gdscript_basics.rst

@@ -986,9 +986,9 @@ nature of the tab-based indentation, ``elif`` can be used instead of
 
 ::
 
-    if [expression]:
+    if (expression):
         statement(s)
-    elif [expression]:
+    elif (expression):
         statement(s)
     else:
         statement(s)
@@ -1003,7 +1003,7 @@ Short statements can be written on the same line as the condition::
 Sometimes, you might want to assign a different initial value based on a
 boolean expression. In this case, ternary-if expressions come in handy::
 
-    var x = [value] if [expression] else [value]
+    var x = (value) if (expression) else (value)
     y += 3 if y < 10 else -1
 
 Ternary-if expressions can be nested to handle more than 2 cases. When nesting