Menu
CoddyTech

Recap - Simple Logic

Part of the Fundamentals section of Coddy's GDScript journey. Lesson 23 of 92.

challenge icon

Challenge

Easy

The 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 = true

Try 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

Practice on your own: Online GDScript compiler