Workshop 3 Games and tools for programming Session

  • Slides: 28
Download presentation
Workshop 3: Games and tools for programming Session 2: Basic programming concepts The sole

Workshop 3: Games and tools for programming Session 2: Basic programming concepts The sole responsibility for the content of this presentation lies with the authors. It does not necessarily reflect the opinion of the European Union.

Authors and licence Authors: • Jasminka Mezak, University of Rijeka, Faculty of Teacher Education

Authors and licence Authors: • Jasminka Mezak, University of Rijeka, Faculty of Teacher Education jasminka. mezak@ufri. uniri. hr • Marina Ivašić-Kos, University of Rijeka, Department of Informatics marinai@inf. uniri. hr This work is licensed under a Creative Commons Attribution-Share. Alike 4. 0 International License. Attribution should be given in the following way: GLAT project, https: //ec. europa. eu/programmes/erasmusplus/projects/eplus-project-details/#project/2017 -1 -HR 01 -KA 201 -035362 2 The sole responsibility for the content of this presentation lies with the authors. It does not necessarily reflect the opinion of the European Union.

Agenda • Introduction - Programming languages • Basic programming concepts • Programming concepts in

Agenda • Introduction - Programming languages • Basic programming concepts • Programming concepts in different education games 3 The sole responsibility for the content of this presentation lies with the authors. It does not necessarily reflect the opinion of the European Union.

Computer programme • A program is a sequence of commands executed in the exact

Computer programme • A program is a sequence of commands executed in the exact order. • Described in the language that the computer understands the programming language Task: Get the nectar and make honey! Visual programming Source code in Java. Script https: //studio. code. org/s/course 1 /stage/14/puzzle/7 4 The sole responsibility for the content of this presentation lies with the authors. It does not necessarily reflect the opinion of the European Union.

Programming languages • Languages used to write computer programs • Each programming language has:

Programming languages • Languages used to write computer programs • Each programming language has: • alphabet - character set used • syntax rules (grammar) description of commands and data, rules of consignment of commands • semantic rules - describe the purpose, meaning, action performed by the command. • Each programming language uses a set of words of special significance called the keywords 5 The sole responsibility for the content of this presentation lies with the authors. It does not necessarily reflect the opinion of the European Union.

Programming with blocks • Visual programming languages • the program code is presented in

Programming with blocks • Visual programming languages • the program code is presented in blocks • used in the initial learning of programming • Advantage it is not necessary to learn the syntax • students create a program by stacking the blocks • Examples: • • Blockly Run Marco! Scratch … 6 The sole responsibility for the content of this presentation lies with the authors. It does not necessarily reflect the opinion of the European Union.

Basic programming concepts 1. 2. 3. 4. Sequence Loops (Iteration) Variables Branching (if condition)

Basic programming concepts 1. 2. 3. 4. Sequence Loops (Iteration) Variables Branching (if condition) 7 The sole responsibility for the content of this presentation lies with the authors. It does not necessarily reflect the opinion of the European Union.

Sequence • The commands in the program need to be specified in a certain

Sequence • The commands in the program need to be specified in a certain order • Examples of simple sequences in games: • moving along the path • collecting objects • executing actions • … 8 The sole responsibility for the content of this presentation lies with the authors. It does not necessarily reflect the opinion of the European Union.

Analysing examples Group activity The sole responsibility for the content of this presentation lies

Analysing examples Group activity The sole responsibility for the content of this presentation lies with the authors. It does not necessarily reflect the opinion of the European Union.

Sequence – Example 1 Code. org: Artist or https: //studio. code. org/s/course 1/ stage/10/puzzle/1

Sequence – Example 1 Code. org: Artist or https: //studio. code. org/s/course 1/ stage/10/puzzle/1 10 The sole responsibility for the content of this presentation lies with the authors. It does not necessarily reflect the opinion of the European Union.

Sequence – Example 2 Code. org: Bee https: //studio. code. org/s/course 1/ stage/7/puzzle/3 11

Sequence – Example 2 Code. org: Bee https: //studio. code. org/s/course 1/ stage/7/puzzle/3 11 The sole responsibility for the content of this presentation lies with the authors. It does not necessarily reflect the opinion of the European Union.

naredbe Loop . $ak�a se pr • The loop is a construct that causes

naredbe Loop . $ak�a se pr • The loop is a construct that causes a group of one or more commands to be invoked repeatedly until some end condition is met: 1. number of repetitions is known in advance 2. number of repetitions is not known sintaksa • Examples of using loops in games: • moving characters • performing the action • … 12 The sole responsibility for the content of this presentation lies with the authors. It does not necessarily reflect the opinion of the European Union.

Analysing examples Group activity The sole responsibility for the content of this presentation lies

Analysing examples Group activity The sole responsibility for the content of this presentation lies with the authors. It does not necessarily reflect the opinion of the European Union.

Loop - Example 1 Run Marco! Level 11 https: //www. brainpop. com/games/runmarco/ 14 The

Loop - Example 1 Run Marco! Level 11 https: //www. brainpop. com/games/runmarco/ 14 The sole responsibility for the content of this presentation lies with the authors. It does not necessarily reflect the opinion of the European Union.

Loop - Example 2 Code. org: Code with Anna and Elsa https: //studio. code.

Loop - Example 2 Code. org: Code with Anna and Elsa https: //studio. code. org/s/frozen/ stage/1/puzzle/5 15 The sole responsibility for the content of this presentation lies with the authors. It does not necessarily reflect the opinion of the European Union.

Variables • Variables are used to keep values (text, numbers, …) and reuse these

Variables • Variables are used to keep values (text, numbers, …) and reuse these values. • Variables have name and value (for most programming languages also the type) • Examples of using variables in games: • text or sound - what will a character say • values used for moving characters (number of steps, turns, …) • number of lives, collected items, points, … • time left to finish the game • … 16 The sole responsibility for the content of this presentation lies with the authors. It does not necessarily reflect the opinion of the European Union.

Analysing examples Group activity The sole responsibility for the content of this presentation lies

Analysing examples Group activity The sole responsibility for the content of this presentation lies with the authors. It does not necessarily reflect the opinion of the European Union.

Variables - Example 1 Code club: Scratch - Ghostbusters https: //scratch. mit. edu/projects/60787262/ 18

Variables - Example 1 Code club: Scratch - Ghostbusters https: //scratch. mit. edu/projects/60787262/ 18 The sole responsibility for the content of this presentation lies with the authors. It does not necessarily reflect the opinion of the European Union.

Variables - Example 2 Blockly Games: Turtle https: //blockly-games. appspot. com/turtle? lang=en 19 The

Variables - Example 2 Blockly Games: Turtle https: //blockly-games. appspot. com/turtle? lang=en 19 The sole responsibility for the content of this presentation lies with the authors. It does not necessarily reflect the opinion of the European Union.

naredbe Branching . $ak�a se pr • The program can take certain routes depending

naredbe Branching . $ak�a se pr • The program can take certain routes depending on the fulfilled conditions. • Examples of using branching in games: • • • moving characters changing values of variables (lost life, getting points) showing and hiding characters/items ending the game … sintaksa 20 The sole responsibility for the content of this presentation lies with the authors. It does not necessarily reflect the opinion of the European Union.

naredbe Branching – Conditions and operators . $ak�a se pr • A path that

naredbe Branching – Conditions and operators . $ak�a se pr • A path that has a fulfilled condition is selected Relational operators Logical operators sintaksa 21 The sole responsibility for the content of this presentation lies with the authors. It does not necessarily reflect the opinion of the European Union.

Analysing examples Group activity The sole responsibility for the content of this presentation lies

Analysing examples Group activity The sole responsibility for the content of this presentation lies with the authors. It does not necessarily reflect the opinion of the European Union.

Branching - Example 1 Blockly Games: Bird https: //blockly-games. appspot. com/bird? lang=en&level=2 23 The

Branching - Example 1 Blockly Games: Bird https: //blockly-games. appspot. com/bird? lang=en&level=2 23 The sole responsibility for the content of this presentation lies with the authors. It does not necessarily reflect the opinion of the European Union.

Branching - Example 2 Run Marco! Level 31 https: //www. brainpop. com/games/runmarco/ 24 The

Branching - Example 2 Run Marco! Level 31 https: //www. brainpop. com/games/runmarco/ 24 The sole responsibility for the content of this presentation lies with the authors. It does not necessarily reflect the opinion of the European Union.

Exploring and discussing games Group activity The sole responsibility for the content of this

Exploring and discussing games Group activity The sole responsibility for the content of this presentation lies with the authors. It does not necessarily reflect the opinion of the European Union.

Exploring games Choose one of the following games and explore it: • Code. org:

Exploring games Choose one of the following games and explore it: • Code. org: https: //studio. code. org/s/course 1 • Blockly games: https: //blockly-games. appspot. com/? lang=en • Run Marco: https: //www. brainpop. com/games/runmarco/ Discuss chosen game and its possible application for learning the basic programming concepts. 26 The sole responsibility for the content of this presentation lies with the authors. It does not necessarily reflect the opinion of the European Union.

Additional resources • Hopscotch, https: //www. gethopscotch. com/ (15. 6. 2019. ) • Minecraft,

Additional resources • Hopscotch, https: //www. gethopscotch. com/ (15. 6. 2019. ) • Minecraft, https: //education. minecraft. net/trainings/code-builder-forminecraft-education-edition/ (15. 6. 2019. ) • Educational App Store, https: //www. educationalappstore. com/best-apps-forkids-and-students (15. 6. 2019. ) • Coding Google Doodle! https: //www. google. com/doodles/celebrating-50 years-of-kids-coding? doodle=32615474&domain_name=google. com&hl=en (15. 6. 2019. ) 27 The sole responsibility for the content of this presentation lies with the authors. It does not necessarily reflect the opinion of the European Union.

Questions 28 The sole responsibility for the content of this presentation lies with the

Questions 28 The sole responsibility for the content of this presentation lies with the authors. It does not necessarily reflect the opinion of the European Union.