Recap - Simple Logic
Part of the Fundamentals section of Coddy's GDScript journey. Lesson 23 of 92.
Challenge
EasyThe variables b1, b2 and b3 all start as false. Set each of them to true or false so that b4 is true.
Only change the values of b1, b2 and b3. Do not change the line of b4 or the print() line. The output must be:
b4 = trueTry it yourself
extends Node
func _ready():
# Change the values below
var b1: bool = false
var b2: bool = false
var b3: bool = false
# Don't change the lines below
var b4: bool = (b1 or b2) and not (b1 and b2) and not b3
print("b4 = ", b4)
All lessons in Fundamentals
4Operators Part 1
Arithmetic OperatorsInteger DivisionModulo OperatorArithmetic ShortcutsRecap - Simple MathComparison Operators10Functions
Declare a FunctionArgumentsReturnReturn TypesRecap - Sigma FunctionRecap - Validation FunctionDefault Values5Operators Part 2
Logical Operators Part 1Logical Operators Part 2Recap - Simple LogicLogical Operators Part 3Ternary OperatorPractice on your own: Online GDScript compiler