Menu
CoddyTech

Recap - Simple Math

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

challenge icon

Challenge

Easy

Change the values of a and b so that:

  • c, which holds a * b, is 24
  • d, which holds a / b, is 6

Both are integers, so a / b drops the decimal part. Do not change the lines that declare c and d or the print() lines. The output must be:

c = 24
d = 6

Try it yourself

extends Node

func _ready():
	# Change the values of a and b
	var a: int = 0
	var b: int = 1

	# Don't change the lines below
	var c: int = a * b
	var d: int = a / b
	print("c = ", c)
	print("d = ", d)

All lessons in Fundamentals

Practice on your own: Online GDScript compiler