Programming challenges
As you learned throughout this book, Luau is a fast and powerful language. In this section, we will explore more general programming challenges to increase your understanding of and proficiency in the language. Note that each example will reinforce important programming concepts for making systems in your experiences. These challenges will be roughly sorted so that easier ones are at the beginning of the section and more difficult ones at the end.
Is number x divisible by y?
We’ll start simple. In a script in Roblox Studio, define a function that returns whether a passed-in number x is divisible by a passed-in number y. We define divisibility as x going evenly into y. Remember to look for possible issues with your implementation; if the user passes in 0 for y, will your function break? If yes, what cases might you consider to always return a sensible value?
FizzBuzz
This is a programming challenge that many companies might decide to quiz...