Game Overview
Part of the Fundamentals section of Coddy's Kotlin journey. Lesson 63 of 93.
Challenge
MediumIn this chapter, you'll build a customizable FizzBuzz game step by step.
To start, implement the traditional FizzBuzz for numbers 1 to 15 using the standard divisors 3 and 5.
For each number from 1 to 15:
- Print
FizzBuzzif the number is divisible by both 3 and 5 - Print
Fizzif the number is divisible by 3 only - Print
Buzzif the number is divisible by 5 only - Print the number itself otherwise
Each output should be on its own line.
Try it yourself
fun main() {
// TODO: Write your code below
// Implement FizzBuzz for numbers 1 to 15
// - Print "FizzBuzz" if divisible by both 3 and 5
// - Print "Fizz" if divisible by 3 only
// - Print "Buzz" if divisible by 5 only
// - Print the number itself otherwise
}All lessons in Fundamentals
4Operators Part 1
Arithmetic OperatorsModulo OperatorAugmented AssignmentComparison OperatorsRecap - Simple Math7Basic IO
Println FunctionString TemplatesReadLine InputType ConversionRecap - Years Until RetirementRecap - True or False10Functions
Declare A FunctionParameters And ArgumentsReturn ValuesNamed ArgumentsDefault ValuesSingle Expression FunctionsRecap - Sigma FunctionRecap - Validation Function2Variables
Val vs VarType InferenceNumbersStringBooleanNaming ConventionsRecap - Initialize Variables5Operators Part 2
Logical Operators Part 1Logical Operators Part 2Logical Operators Part 3Ternary With If ExpressionRecap - Simple Logic8Bill Split Calculator
Welcome MessageGetting Input3Nullability
What Is Null SafetyNullable TypesSafe Call OperatorElvis OperatorFunction Challenge BasicsNot Null AssertionRecap - Safe Access6Decision Making
If StatementIf - ElseIf As An ExpressionWhen ExpressionWhen With RangesRecap - Simple Calculator9Loops
For LoopWhile LoopDo-While LoopBreakContinueRanges In LoopsNested LoopRecap - FactorialRecap - Dynamic InputPractice on your own: Kotlin playground