Code Combat.

Slides:



Advertisements
Similar presentations
Summer Computing Workshop. Introduction to Variables Variables are used in every aspect of programming. They are used to store data the programmer needs.
Advertisements

Microsoft® Access® 2010 Training
CATHERINE AND ANNIE Python: Part 3. Intro to Loops Do you remember in Alice when you could use a loop to make a character perform an action multiple times?
Python (yay!) November 16, Unit 7. Recap We can store values in variables using an assignment statement >>>x = We can get input from the user using.
IT-101 Section 001 Lecture #3 Introduction to Information Technology.
Programming with Alice Computing Institute for K-12 Teachers Summer 2011 Workshop.
 We are going to learn about programming in general…How to think logically and problem solve. The programming language we will use is Python. This is.
PYTHON: PART 2 Catherine and Annie. VARIABLES  That last program was a little simple. You probably want something a little more challenging.  Let’s.
Lesson 4 Using Variables in Python – Creating a Simple ChatBot Program.
PROGRAMMING In Lesson 2. STARTER ACTIVITY Complete the starter activity in your python folder – lesson 2 Now we will see how you got on and update your.
Python Programming Using Variables and input. Objectives We’re learning to use basic knowledge of variables combined with user input. Outcomes Continue.
A First Program CSE 1310 – Introduction to Computers and Programming Vassilis Athitsos University of Texas at Arlington Credits: a significant part of.
CLICK THE NUMBERS IN SEQUENCE
Introduction to Computer Programming - Project 2 Intro to Digital Technology.
+ Aeries Parent-Student Portal Directions Le Grand Union High School District.
Learning to use a ‘For Loop’ and a ‘Variable’. Learning Objective To use a ‘For’ loop to build shapes within your program Use a variable to detect input.
Introduction to Programming: Module 1 Blockly
JavaScript: Conditionals contd.
Week 2 - Wednesday CS 121.
More about comments Review Single Line Comments The # sign is for comments. A comment is a line of text that Python won’t try to run as code. Its just.
MOM! Phineas and Ferb are … Aims:
Intro CS – Screens and Variables
Release Numbers MATLAB is updated regularly
A Playful Introduction to Programming by Jason R. Briggs
Scratch for Interactivity
IF statements.
Warm-up Program Use the same method as your first fortune cookie project and write a program that reads in a string from the user and, at random, will.
– Officiating Management Software
Unit 2 Smarter Programming.
Let's Race! Typing on the Home Row
Learning to program with Logo
Frozen Graphics Lesson 3.
Lesson 2: Building Blocks of Programming
By Sanjay and Arvind Seshan
Code Combat.
Learn… Create… Program
Number Words   two one three.
For -G7 programing language Teacher / Shamsa Hassan Alhassouni.
Go to =>
Learn… Create… Program
Topic 1: Problem Solving
Loops CIS 40 – Introduction to Programming in Python
Hacking Minecraft on the Raspberry Pi using Python
We’re moving on to more recap from other programming languages
Introduction to TouchDevelop
By Sanjay and Arvind Seshan
Forth A stack language.
Hour of Code.
Go to =>
Problem Solving Designing Algorithms.
A look at Python Programming Language 2018.
Chapter 3: Selection Structures: Making Decisions
For loops Taken from notes by Dr. Neil Moore
Building Java Programs
Introduction to Primitives
Introduction to Primitives
CLICK THE NUMBERS IN SEQUENCE
Chapter 3: Selection Structures: Making Decisions
Prepared By: Deborah Becker
Learn… Create… Program
Learn… Create… Program
CHOOSE THE CORRECT NUMBER
Welcome back! October 11, 2018.
Creating a Simple Game in Scratch
CLICK THE NUMBERS IN SEQUENCE
Class code for pythonroom.com cchsp2cs
Software Development Techniques
Presentation transcript:

Code Combat

So you want to learn to code, eh? Welcome! So you want to learn to code, eh?

Welcome I will be your host to the dark arts of … err I mean Programming CodeCombat is a fun, addictive, and effective way of learning real, line based code.

Introduction I will teach and test you along the way through challenging puzzle & battle based levels

Introduction The code you are writing uses real syntax, meaning the lines you write to solve these puzzles are real lines of code

Enough talk - let’s start! Navigate to codecombat.com. Click the big play button at the center of your screen. Then down at the bottom of the screen select Sign Up to create your account.

Getting started Once you have entered your information, select the first world, Kithgard Dungeon

Getting started Select the first level, then select your character, being sure to chose Python as your language

Level One Double click the boots to equip them. Then click play.

Level One In the bottom right there is an inventory. Look there are your boots!

Methods Hover over one of the orange lines - these are methods - to learn a bit about what they do

Methods Methods are like functions, but associated with a specific object.

Review: Functions

For example look at built in function block on the left from scratch Review: Functions For example look at built in function block on the left from scratch This “If on edge, bounce” block is equivalent to these 5 blocks. Instead of using the five to the right, you can just use the one block

Methods So if methods are associated with a specific object, what is the object for moveDown? Object Method (note parentheses) Attached by a period

Methods The object here is ‘self’ - which refers to your player. Self is actually a variable that stores information about your player, like their location

Modules In code combat, it’s the boot that allows us to use these move methods. As the game continues, you will get more armor/weapons etc. that will give you access to additional methods

Modules In python you use import lines to import libraries or modules. These are bundles of functions for you to use.

Level One: Dungeons of Kithgard

Help In case you get completely stuck, you can always use the help button

Level Two: Gems in the Deep Note: you must moveUp twice - first to the red circle, then to the top gem

Level Three: Shadow Guard Select the first level, then select your character - being sure to chose Python as your language Note: Sometimes it’s not the easiest route that works...

Level Four: Forgetful Gemsmith Select the first level, then select your character - being sure to chose Python as your language Why would taking the lower route first not work?

Level Four: Forgetful Gemsmith Select the first level, then select your character - being sure to chose Python as your language Note the difference in length

Level Five: True Names New sword means new method! Hover over sword to reveal information:

Data Types Computers understand different kinds of values, for example numbers (integers/floating point numbers) to characters (strings)

Data Types

Note: the names are strings Level Five: True Names Note: the names are strings

Level Six: The Raised Sword Can’t get past this level, despite correct code? Go back and get some armor! NOTE: No new methods, just increases your health

Level Seven: Haunted Kithmaze New book! We can now access looping

Level Seven: Haunt Kithmaze Hover over book to learn more

Loops Loops are used to repeat a sequence of code, either a set number of times, forever, or until a condition is False

Level Seven: Haunt Kithmaze Loop allows the same lines of code to be repeated

Level Eight: Second Kithmaze Can you find the pattern?

Level Eight: Second Kithmaze Make sure you indent the move lines

Level Nine: Dread Door

Level Ten: Known Enemy Why is “Kratt” in quotations but enemy1 is not?

Variables A variable is a named container in which an item of data can be stored, much like a real-life object can be stored in a box.

Variable assignment In line 1 we store the integer value 3 to the variable age. In line 2 we store the string value “Dubick” to the variable name.

Variable assignment It is important to note that you can name your variable (almost) anything

But just because you can doesn’t mean you should! Variable assignment But just because you can doesn’t mean you should! Try and name variables so that their purpose is clear. This will save a lot of headaches in the future.

Level Nine: Dread Door So why is this helpful? Isn’t it more lines of code?

Level Nine: Dread Door Variables are useful because they are a way to write code for a changing or yet unknown value We will see why this is useful next level

Level 11: Master of Names New method!

Level 11: Master of Names

Level 11: Master of Names This line locates the enemy nearest to your player and saves their name as a string to the variable enemy 1 This line then attacks that enemy.

12 & 13: Lowly Kithman, Closing the Distance In case you get stuck...

Level 14: The Final Kithmaze Can you spot the pattern?

Level 14: The Final Kithmaze

Level 15: The Final Kithmaze

Level 15: The Final Kithmaze

Level 15: The Final Kithmaze

Onto the next world in Lesson 2!