SlideShare a Scribd company logo
1 of 34
Coding with Minecraft 4:
Variables
The importance of variables
The different kinds of variables
To code a game in Minecraft with variables
Number variable – This holds numeric data.
Examples: a person’s age, a player’s score, the year
String variable – This holds a string of alphanumeric characters.
Examples: a person’s name, a password, the day of the week
Boolean variable – This has only two possible values: true or false.
Examples: Is it daytime? Is the game over?
Position variable in MakeCode – A special kind of variable that holds three
numbers that describe a specific location in three-dimensional space.
CHICKEN STORM
CHICKEN STORM
CHALLENGE 1 - MEANINGFUL
VARIABLE NAMES
• Let’s change the code so we are not using
“num1”
• The name num1 does not represent
anything meaningful and could be hard to
understand a big block of code.
• Instead, name your new variable
“ChickenNum” because the number you
store is the number of chickens.
CHALLENGE 2 - GIVING
FEEDBACK
• Let’s have the chicken rain machine
speak back to you.
• Right before you the chickens start
falling the response would be “5
Chickens! Coming right up!” Then 5
chickens will fall on your head!
CHALLENGE 2 - GIVING
FEEDBACK
To do this, you will need to…
1. Figure out how to “say” things in the
chat window
2. Use the join block to put together
ChickenNum + “ chickens! Coming
right up!”
3. Put this new block in the right location
in your code. If you put it in the wrong
spot, the chat window will respond
many times
CHALLENGE 2 - GIVING
FEEDBACK
REVIEW
• What did your variable determine in
the game?
• Why is it good coding practice to
give variables meaningful names?
To code variables in Minecraft to:
• Count things
• Keep score
• Create a report of your game’s activities
ARROW
COUNTER
ARROW
COUNTER
CHALLENGE 1 - 10
ARROWS ONLINE
CHALLENGE 2 -
PROVIDING A MESSAGE
EXTENSION 1- TARGET
PRACTICE
EXTENSION 2- HOW
MANY RABBITS?
FALLS IN THE AIR
FALLS IN THE AIR - STEP 1
FALLS IN THE AIR - STEP 2
HOW DOES THE VARIABLE
WORK?
EXTENSION 1 - TRACK SWIM
DISTANCE
To use variables in Minecraft to:
• Count things
• Keep score
• Create a report of your game’s activities
LESSON C :
COMBINING VARIABLES
Combining variables to create
messages in the sky
Check our learning progress with a quiz
Make your own unique
situations
Combine the variables to
create chains of words
Create a variable that stands
for a word
To create your own MakeCode projects
that use variables to activate different parts of
your program
INDEPENDENT
PROJECT
For this project, create an original
MakeCode project that uses multiple
variables of at least two different types,
to keep track of information in
Minecraft.
Also, find a way to use a chat
command with a parameter.
INDEPENDENT
PROJECT
Information you might store in
variables / project ideas:
• Store the number of something you spawn
• Store text for the animal you spawned
• Store your position
• Store words to put together to make
sentences.
MINECRAFT DIARY
ENTRY
• What type of information did you choose
to keep track of?
• What problems did you encounter?
How did you solve them?
• How did you use variables in your project, and
what were their types?
• What did you name your variables and why?
• What was something new that you learned for this
project? Describe how you figured
it out.
• Include at least one screenshot of your project.

More Related Content

What's hot

웹 개발을 위해 꼭 알아야하는 보안 공격
웹 개발을 위해 꼭 알아야하는 보안 공격웹 개발을 위해 꼭 알아야하는 보안 공격
웹 개발을 위해 꼭 알아야하는 보안 공격
선협 이
 
Introduction to scratch
Introduction to scratchIntroduction to scratch
Introduction to scratch
emreyz
 

What's hot (20)

Core java
Core java Core java
Core java
 
Scratch Animation
Scratch AnimationScratch Animation
Scratch Animation
 
웹 개발을 위해 꼭 알아야하는 보안 공격
웹 개발을 위해 꼭 알아야하는 보안 공격웹 개발을 위해 꼭 알아야하는 보안 공격
웹 개발을 위해 꼭 알아야하는 보안 공격
 
Ev3 teachers guia
Ev3 teachers guiaEv3 teachers guia
Ev3 teachers guia
 
Introduction to flutter
Introduction to flutter Introduction to flutter
Introduction to flutter
 
C# language
C# languageC# language
C# language
 
Introduction of c language
Introduction of c languageIntroduction of c language
Introduction of c language
 
Summer training presentation on "CORE JAVA".
Summer training presentation on "CORE JAVA".Summer training presentation on "CORE JAVA".
Summer training presentation on "CORE JAVA".
 
Intro To Scratch
Intro To ScratchIntro To Scratch
Intro To Scratch
 
SD & D Input Validation
SD & D Input ValidationSD & D Input Validation
SD & D Input Validation
 
Android studio 디버거 조금 더 잘 쓰기
Android studio 디버거 조금 더 잘 쓰기Android studio 디버거 조금 더 잘 쓰기
Android studio 디버거 조금 더 잘 쓰기
 
Introduction to mobile application development
Introduction to mobile application developmentIntroduction to mobile application development
Introduction to mobile application development
 
Scratch Lesson 6
Scratch Lesson 6Scratch Lesson 6
Scratch Lesson 6
 
iOS Development - A Beginner Guide
iOS Development - A Beginner GuideiOS Development - A Beginner Guide
iOS Development - A Beginner Guide
 
Evolution Of Java
Evolution Of JavaEvolution Of Java
Evolution Of Java
 
Introduction to scratch programming
Introduction to scratch programmingIntroduction to scratch programming
Introduction to scratch programming
 
Introduction to scratch
Introduction to scratchIntroduction to scratch
Introduction to scratch
 
NHN NEXT 게임 전공 소개
NHN NEXT 게임 전공 소개NHN NEXT 게임 전공 소개
NHN NEXT 게임 전공 소개
 
Java project
Java projectJava project
Java project
 
Mobile Testing with Appium
Mobile Testing with AppiumMobile Testing with Appium
Mobile Testing with Appium
 

Similar to Lesson 3 - Coding with Minecraft - Variables.pptx

Intro to javascript (5:2)
Intro to javascript (5:2)Intro to javascript (5:2)
Intro to javascript (5:2)
Thinkful
 
Intro to javascript (6:19)
Intro to javascript (6:19)Intro to javascript (6:19)
Intro to javascript (6:19)
Thinkful
 
Python part two names and types
Python part two names and typesPython part two names and types
Python part two names and types
grahamwell
 

Similar to Lesson 3 - Coding with Minecraft - Variables.pptx (14)

RBuilder and ByteSurgeon
RBuilder and ByteSurgeonRBuilder and ByteSurgeon
RBuilder and ByteSurgeon
 
Intro to javascript (5:2)
Intro to javascript (5:2)Intro to javascript (5:2)
Intro to javascript (5:2)
 
Week 1
Week 1Week 1
Week 1
 
Intro to javascript (6:19)
Intro to javascript (6:19)Intro to javascript (6:19)
Intro to javascript (6:19)
 
Visual basic intoduction
Visual basic intoductionVisual basic intoduction
Visual basic intoduction
 
Intro to javascript (6:27)
Intro to javascript (6:27)Intro to javascript (6:27)
Intro to javascript (6:27)
 
Python part two names and types
Python part two names and typesPython part two names and types
Python part two names and types
 
Variables
VariablesVariables
Variables
 
Thinkful - Intro to JavaScript
Thinkful - Intro to JavaScriptThinkful - Intro to JavaScript
Thinkful - Intro to JavaScript
 
Visual Basic Review - ICA
Visual Basic Review - ICAVisual Basic Review - ICA
Visual Basic Review - ICA
 
Lecture 2: C# Programming for VR application in Unity
Lecture 2: C# Programming for VR application in UnityLecture 2: C# Programming for VR application in Unity
Lecture 2: C# Programming for VR application in Unity
 
C# 101: Intro to Programming with C#
C# 101: Intro to Programming with C#C# 101: Intro to Programming with C#
C# 101: Intro to Programming with C#
 
Section1 compound data class
Section1 compound data classSection1 compound data class
Section1 compound data class
 
Intro to JavaScript - Thinkful LA, June 2017
Intro to JavaScript - Thinkful LA, June 2017Intro to JavaScript - Thinkful LA, June 2017
Intro to JavaScript - Thinkful LA, June 2017
 

More from missstevenson01

Lesson 2 - Coding with Minecraft - Events.pptx
Lesson 2 - Coding with Minecraft - Events.pptxLesson 2 - Coding with Minecraft - Events.pptx
Lesson 2 - Coding with Minecraft - Events.pptx
missstevenson01
 

More from missstevenson01 (20)

S3 environment
S3 environmentS3 environment
S3 environment
 
The Processor.pptx
The Processor.pptxThe Processor.pptx
The Processor.pptx
 
How Computers Work
How Computers WorkHow Computers Work
How Computers Work
 
Lesson 2 - Coding with Minecraft - Events.pptx
Lesson 2 - Coding with Minecraft - Events.pptxLesson 2 - Coding with Minecraft - Events.pptx
Lesson 2 - Coding with Minecraft - Events.pptx
 
Lesson2 - Coding with Minecraft - Events.pptx
Lesson2 - Coding with Minecraft - Events.pptxLesson2 - Coding with Minecraft - Events.pptx
Lesson2 - Coding with Minecraft - Events.pptx
 
Ethical hacking trojans, worms and spyware
Ethical hacking    trojans, worms and spywareEthical hacking    trojans, worms and spyware
Ethical hacking trojans, worms and spyware
 
Ethical hacking anti virus
Ethical hacking   anti virusEthical hacking   anti virus
Ethical hacking anti virus
 
Ethical hacking introduction to ethical hacking
Ethical hacking   introduction to ethical hackingEthical hacking   introduction to ethical hacking
Ethical hacking introduction to ethical hacking
 
S1 internet safety-chattingonline
S1 internet safety-chattingonlineS1 internet safety-chattingonline
S1 internet safety-chattingonline
 
S3 wireframe diagrams
S3 wireframe diagramsS3 wireframe diagrams
S3 wireframe diagrams
 
Sql
SqlSql
Sql
 
Alien database
Alien databaseAlien database
Alien database
 
Video Games and Copyright laws
Video Games and Copyright lawsVideo Games and Copyright laws
Video Games and Copyright laws
 
Games Design Document
Games Design DocumentGames Design Document
Games Design Document
 
Video game proposal
Video game proposalVideo game proposal
Video game proposal
 
Evaluation
EvaluationEvaluation
Evaluation
 
H evaluation
H evaluationH evaluation
H evaluation
 
H testing and debugging
H testing and debuggingH testing and debugging
H testing and debugging
 
H file handling
H file handlingH file handling
H file handling
 
Standard algorithms
Standard algorithmsStandard algorithms
Standard algorithms
 

Recently uploaded

The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
heathfieldcps1
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch Letter
MateoGardella
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
kauryashika82
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
negromaestrong
 

Recently uploaded (20)

PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch Letter
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 

Lesson 3 - Coding with Minecraft - Variables.pptx

  • 1. Coding with Minecraft 4: Variables
  • 2.
  • 3. The importance of variables The different kinds of variables To code a game in Minecraft with variables
  • 4. Number variable – This holds numeric data. Examples: a person’s age, a player’s score, the year String variable – This holds a string of alphanumeric characters. Examples: a person’s name, a password, the day of the week Boolean variable – This has only two possible values: true or false. Examples: Is it daytime? Is the game over? Position variable in MakeCode – A special kind of variable that holds three numbers that describe a specific location in three-dimensional space.
  • 7. CHALLENGE 1 - MEANINGFUL VARIABLE NAMES • Let’s change the code so we are not using “num1” • The name num1 does not represent anything meaningful and could be hard to understand a big block of code. • Instead, name your new variable “ChickenNum” because the number you store is the number of chickens.
  • 8. CHALLENGE 2 - GIVING FEEDBACK • Let’s have the chicken rain machine speak back to you. • Right before you the chickens start falling the response would be “5 Chickens! Coming right up!” Then 5 chickens will fall on your head!
  • 9. CHALLENGE 2 - GIVING FEEDBACK To do this, you will need to… 1. Figure out how to “say” things in the chat window 2. Use the join block to put together ChickenNum + “ chickens! Coming right up!” 3. Put this new block in the right location in your code. If you put it in the wrong spot, the chat window will respond many times
  • 10. CHALLENGE 2 - GIVING FEEDBACK
  • 11. REVIEW • What did your variable determine in the game? • Why is it good coding practice to give variables meaningful names?
  • 12.
  • 13. To code variables in Minecraft to: • Count things • Keep score • Create a report of your game’s activities
  • 16. CHALLENGE 1 - 10 ARROWS ONLINE
  • 21. FALLS IN THE AIR - STEP 1
  • 22. FALLS IN THE AIR - STEP 2
  • 23. HOW DOES THE VARIABLE WORK?
  • 24. EXTENSION 1 - TRACK SWIM DISTANCE
  • 25. To use variables in Minecraft to: • Count things • Keep score • Create a report of your game’s activities
  • 26. LESSON C : COMBINING VARIABLES
  • 27. Combining variables to create messages in the sky Check our learning progress with a quiz
  • 28. Make your own unique situations Combine the variables to create chains of words Create a variable that stands for a word
  • 29.
  • 30.
  • 31. To create your own MakeCode projects that use variables to activate different parts of your program
  • 32. INDEPENDENT PROJECT For this project, create an original MakeCode project that uses multiple variables of at least two different types, to keep track of information in Minecraft. Also, find a way to use a chat command with a parameter.
  • 33. INDEPENDENT PROJECT Information you might store in variables / project ideas: • Store the number of something you spawn • Store text for the animal you spawned • Store your position • Store words to put together to make sentences.
  • 34. MINECRAFT DIARY ENTRY • What type of information did you choose to keep track of? • What problems did you encounter? How did you solve them? • How did you use variables in your project, and what were their types? • What did you name your variables and why? • What was something new that you learned for this project? Describe how you figured it out. • Include at least one screenshot of your project.