Menu
Coddy logo textTech

Recap - Area Calculator

Part of the Fundamentals section of Coddy's Lua journey — lesson 55 of 90.

challenge icon

Challenge

Easy

Create a room area calculation system for a game's building mechanics. Declare a function named calculateArea that accepts two parameters: width and height. The function should multiply these two values together and return the calculated area. After declaring the function, call it with the arguments 12 and 8 and store the returned value in a variable called roomArea using a single assignment statement (e.g., roomArea = calculateArea(12, 8)), then print the result.

Try it yourself

-- TODO: Write your code here
-- Declare the calculateArea function
-- Call the function with arguments 12 and 8
-- Store the result in roomArea variable

-- Print the result
print(roomArea)

All lessons in Fundamentals