Recap - Character Profile
Part of the Fundamentals section of Coddy's Lua journey — lesson 11 of 90.
Challenge
EasyCreate variables to represent a complete game character profile using the appropriate data types for each piece of information:
- Create a variable named
characterNameand assign it the string"Warrior" - Create a variable named
characterLeveland assign it the number12 - Create a variable named
characterHealthand assign it the number85 - Create a variable named
isHeroand assign it the booleantrue
After creating all variables, print each one on a separate line in the order they were created.
Expected Output:
Warrior
12
85
trueTry it yourself
-- TODO: Create the character profile variables here
-- TODO: Print each variable on a separate lineAll lessons in Fundamentals
4Operators 2 Relational & Logic
Equality OperatorsRelational OperatorsThe 'and' OperatorThe 'or' OperatorThe 'not' OperatorShort-Circuit EvaluationTruthy and Falsy ValuesRecap - Simple Logic7Basic Conditional Logic
The if-then StatementThe if-then-else StatementThe elseif StatementRecap - Treasure Chest2Variables and Data Types
What is a Variable?NumbersStringsBooleansThe Value 'nil'The type() FunctionNaming ConventionsRecap - Character Profile5Basic Output
Printing LiteralsPrinting VariablesPrinting Multiple ValuesCombining Strings & VariablesThe tostring() FunctionInputCastRecap - Status ReportRecap - Till 1208String Manipulation Basics
string.len()string.upper & string.lowerstring.sub()string.rep()string.find()Recap - Format Username3Operators 1 Arithmetic & Conc
Arithmetic OperatorsModulo OperatorExponentiation OperatorString ConcatenationOperator PrecedenceRecap - Simple Calculations6Project: Character Stats Disp
Welcome MessageDeclare Character Stats9Functions Basics
Declaring a FunctionCalling a FunctionFunctions with ParametersFunctions with Multiple ParamsThe 'return' StatementRecap - Area Calculator