Explain the significance of using a computer programming language. Describe the basic template of the Monogame framework.

Size: px
Start display at page:

Download "Explain the significance of using a computer programming language. Describe the basic template of the Monogame framework."

Transcription

1

2 I can Explain the significance of using a computer programming language. Describe the basic template of the Monogame framework.

3 A series of steps (actions) performed in a specific order Specifies The ACTIONS to be executed The ORDER in which these actions are to be executed

4 Example Making a PBJ Sandwich Rise and Shine Algorithm Rise and Shine Get out of bed Take off pajamas Take a shower Get dressed Eat breakfast Father School Supplies Get a ride to school

5 A combination of English and computer language designed to present a program design Shows the steps involved in solving a problem on the computer that combines an algorithm with partial computer code **outline/rough draft of code.a form of pre-planning**

6 English = confusing language & not specific Words with same spellings (lead the verb vs lead the metal) Phrases with multiple meanings ( break a leg ) Computer Languages invented Straight forward Each word/instruction has one role

7 Are.. PRECISE (no ambiguity) and PERFECT (spelling and order)

8 Uses the C# programming language Monogame has many prebuilt program components Sounds Images Game Pad Keyboard Text Color Game Loop

9

10

11

12

13

14

15 // single line comment /* <comment> */

16 Benefits Others can read and comprehend purpose of your code Finding Errors Remind you of the purpose of each set of code so in a day, a week, a month, a year, etc you will still remember its purpose Requirements You WILL BE required to comment ALL of your code

17 Programming Language used in Monogame Has concepts similar to all programming languages One new change (for students who have only taken Intro in VB) = all statements of code end in a semicolon ; Signifies the end of the line No semicolon means the computer will assume that the line below is a continuation of the instruction from the preceding line

18

19 5 Methods in the Skeleton to be programmed 1. Initialize 2. LoadContent 3. UnloadContent 4. Update 5. Draw

20 Runs ONE time Runs at Beginning of Game Every time the game Runs Ex: Reset scores Reset number of lives Reset Counter Reset Vector, Rectangle

21 Called once per game Load content into your game 3D models Textures Fonts Music Etc

22 Called once per game Will unload unneeded content from the game

23 The main portion of code Called frequently while game is running about 60 times per second All components that must be updated here Objects - Collision Detection Game World - Audio User Input - Variable Changes

24 Called frequently while game is running about 60 times per second Game will consistently redraw itself This method is ONLY for redrawing the screen, variables beyond those related to drawing should be handled and updated in the Update method

25

26 I can... Explain the purpose of variables and objects. Explain the differences between variables and objects. Declare, Initialize, and Assign variables and objects.

27 Data Types: types of data (values) a program can hold 1.Variables 2.Objects

28 The name of a LOCATION in the computer s RAM Stores single piece of information Mailbox Has an address (location) Holds one piece of information

29 byte holds numeric values int holds a positive or negative integer value double holds any number (decimal) char holds a single character string holds line a text bool holds true or false value

30 Counter Score Health Speed Location Time Lives Remaining The possibilities are endless!

31 1. Must START with a letter (upper or lower case) 2. Can include letters, numbers, and underscores (_) 3. Any length 4. Name is CASE SENSITIVE 5. Name should relate to purpose in program

32 1. high_score 2. _hello 3. red1 4. 1red 5. Player#1 6. game-time 7. Counter7 8. main_stage 9. playerone 10.redIntensity!

33 1. high_score 2. _hello 3. red1 4. 1red 5. Player#1 6. game-time 7. Counter7 8. main_stage 9. playerone 10.redIntensity!

34 All variables must be 1. Declared 2. Initialized

35 Defines the Variable gives it a type and gives it a name Type the type of variable Identifier unique name for variable <type> <identifier>; Ex: int score; byte red;

36 Gives the variable a starting value Identifier unique name for variable = sign What should be saved in the variable location <identifier> = <value>; Ex: score = 10; red = 0;

37 Defines and gives the variable a value Type Identifier = sign What should be saved in the variable location Declaration <type> <identifier> = <value>; Ex: int score = 10; byte red = 0; Initialization

38 1. A integer variable called age that holds your age. 2. A Boolean variable called answer that holds the value true 3. A String variable called firstname that holds your first name 4. A double variable called score1 that will hold a value of 30.5

39 1. A integer variable called age that holds your age. a) int age = 25; b) age = 25; c) int age = 25; 2. A Boolean variable called answer that holds the value true. a) bool answer; b) answer = true; c) bool answer = true; 3. A String variable called firstname that holds your first name. a) string firstname; b) firstname = Sarah ; c) string firstname = Sarah ; 4. A double variable called score1 that will hold a value of a) double score1; b) score1 = 30.5; c) double score1 = 30.05;

40 You can reassign the value of the variable at ANY time REWRITES what is saved at that location Original value = Erased Ex: int score = 10; score = 50; score = 20; **score will not remember that it was originally set to 10 or was set to 50 at some point it will only remember that it is currently set to 20.

41 Similar to variables Objects group together similar characteristics together all related, called parameters Store these characteristics together in memory Ex: Color object has a red value, a green value, and blue value Rectangle object has an x location, y location, width, and height Font object has a font family and size value GamePad object has a value for each button identifying if each button is pressed or released **there are MANY different types of objects too many to list and you can create your own as well!**

42 Defines the Object Type the type of Object (generally capitalized) Identifier unique name for Object <type> <identifier>; Ex: Color backgroundcolor; SpriteBatch sprite1; **Object Types has a first letter than is capitalized**

43 Gives the object values Identifier = sign new Type with parameter list (characteristics list) each object has a set order in which its characteristics should be entered Ex: in Color - the first number is the red intensity, second number is the blue intensity, and third number is the green intensity <identifier> = new <type>(<parameters list>); Ex: backgroundcolor = new Color(10, 40, 100);

44 Initialize Gives a singular initial value to start with Variables Instantiate Creates an instance of a class creates an object Objects have characteristics (properties) and actions (methods)

45 Defines the gives the object values Type Identifier = sign new Type with parameter list Declaration <type> <identifier> = new <type>(<parameters list>); Instantiation Ex: Color backgroundcolor = new Color(10, 40, 100);

46 Numerous Types Many Built It Color is one type Too many others to mention Can design our own objects as well Mario Kart Characters special item, image, sound, car, partner Wasn t built in the programmers had to design the object instead

47 1. A Color object named favorite that contains 3 byte parameter values: 40, 100, A Bug object named ladybug that contains 4 parameter of values: red, 7, 2.0, true 3. A Car object named CRV that contains parameter values: 987htg, 2006

48 1. A Color object named favorite that contains 3 byte parameter values: 40, 100, 200 a) Color favorite; b) favorite = new Color(40, 100, 200); c) Color favorite = new Color(40, 100, 200); 2. A Bug object named ladybug that contains 4 parameter of values: red, 7, 2.0, true a) Bug ladybug; b) ladybug = new Bug( red, 7, 2.0, true); c) Bug ladybug = new Bug( red, 7, 2.0, true); 2. A Car object named CRV that contains parameter values: 987htg, 2006 a) Car crv; b) crv = new Car( 987htg, 2006); c) Car crv = new Car( 987htg, 2006);

49 What do you think is the difference between a local and global variable/object?

50 Where you declare the variable/object affects where this variable/object can be used or changed

51 Defined in the Game1 Class at the top of the program Can be used throughout entire program (in all methods) Benefits: accessed from anywhere in program Disadvantages: could be accidentally changed unintentionally in another method

52 Defined in method where being used Can be used ONLY within the method where it is defined defined Benefits: less likely to be accidentally changed Disadvantages: cannot be accessed from elsewhere in the program if needed.

53 Local: term bubbler Used LOCALLY in Wisconsin Elsewhere unknown Global: term hello Known throughout globe as a greeting Different cultures/societies recognize this term

54 Global variables DECLARED for the entire game at the beginning of the program can be used by ALL methods Local object declared inside the draw method and can therefore ONLY be used in the draw method

55

56

57 I can Explain the purpose of a class. Define and provide examples of a method. Label and locate variables, objects, classes, and methods. Explain the connection between a class, object, and method. Explain how classes and methods are like an office building.

58 A template for an object Characteristics list Methods (actions) the object can complete

59 Characteristics of Kodu Health Speed Emotion Invisible Size Color Actions of a Kodu Move Shoot Eat Jump Express Anger

60 Generic Kodu Class template from which all Kodu objects are created All Kodu have the actions (methods) listed in the Kodu class that they can DO All Kodu will have characteristics but these characteristics will vary as each Kodu is different with different characteristics

61 Many already created and built into Monogame Game1 GraphicsDevice Color SpriteBatch GamePadState Keyboard. Can build own as well

62 Numerous characteristics We decide these variables/objects globally defined 5 Methods (actions!) Initialize Load Content Unload Content Update Draw

63 Action an object of the class can run Mini Program with a specific task Ex: In the GamePad class Method called GetState this method will get the state of all the setting of the game pad (buttons, joystick, triggers, etc) and will send these states back to the program

64 Variables and Objects (the information) a method needs to know in order to complete the action and do its job Ex: The GetState method from the GamePad class Takes in one parameter the pad you want to find the state of Without this information, the method will not know what to find the state of

65 Using the dot method <class name>.<method name>(parameter list); (generally how a method call will look in Monogame)

66 GamePad.GetState(Player.One); Keyboard.IsKeyDown(keys.B); GraphicsDevice.Clear(Color.green); Keyboard.GetState(); Note, no parameters Intersection.(Rectangle1, Rectangle2) Note, multiple parameters

67 Create a Moodlight program for Space Use Will run the code to light a panel on the wall Colors will appear to the astronauts in space as you program them to appear

68 Select Monogame Windows Project Save as MoodLight Hide all Comments

69 What happens? Why do you think this happens?

70 **under draw method** GraphicsDevice.Clear(Color.CornflowerBlue); Base.Draw(gameTime); GraphicsDevice.Clear Draws the Blue Screen! Base.Draw calls the Draw Method to run

71 GraphicsDevice.Clear(Color.CornflowerBlue); o GraphicsDevice = class o.clear = calls the clear method in the GraphicsDevice class o Color.CornflowerBlue = parameter taken in by the clear method takes in a Color object and clears the screen to the color provided

72 GraphicsDevice.Clear(Color.CornflowerBlue); Color.CornflowerBlue = preprogrammed Color object Try to change it to another color, what did you do?

73 Color object named: backgroundcolor - Only needs to be accessed by Draw - Define LOCALLY in Draw - Initialize so all red, green, blue values 0 3 Parameters red, green, blue(order MATTER)

74 protected override void Draw(GameTime gametime) { } Color backgroundcolor = new Color(0, 0, 0); GraphicsDevice.Clear(backgroundColor); base.draw(gametime);

75 Color takes in 3 parameters 3 BYTE values, in order representing the red intensity value, green intensity value, and blue intensity value Alter red, green, blue intensities to change color (range in values of 0 255) Color(red, green, blue) Try to create colors record color combinations! Red, Green, Blue, Yellow, Purple, Orange Experiment!!!

76 What if we wanted to individually change each red, green, and blue intensity value?

77 Red, Green, Blue Intensity: - Need to update in update method - Use to draw background color - Want to use in update AND draw method - Define GLOBALLY - Only take values so byte type

78 After class of Game1 Defined define the following: byte red = 0; byte green = 0; byte blue = 0;

79 protected override void Draw(GameTime gametime) { } Color backgroundcolor; backgroundcolor = new Color(red, green, blue); GraphicsDevice.Clear(backgroundColor); base.draw(gametime);

80 protected override void Update(GameTime gametime) { if(gamepad.getstate(.)exit(); red++; green++; blue++; } base.update(gametime);

81 Update makes changes to the game components Draw Uses these updates to redraw the background BOTH RUN 60 TIMES PER SECOND

82 Fill in the handout with pictures and Notes as you Go Classes and Methods are just like how a business office would run!

83

84 Each class is ONE Office with employees and resources

85 Each employee has a job or Action they are assigned to do. Each employee in an office represents a Method because in Method in a class has a very specific job to perform.

86 1) Each time Mr. Draw s is called and his phone rings, he is told to do his job. 2) Mr. Draw s job first requires him to go to the table, and find the values of the three colors on the desk. NOTE: Mr. Draw represents the Draw Method in our current Moodlight project we are working on. **compare to our code** 3) Next, he must call Ms. Clear (another employee/method in the Graphic Device office/class) and give her the values over the phone so she can clear the screen to the correct color. Once done, Mr. Draw sits down and waits for his next call.

87 protected override void Draw(GameTime gametime) { } Color backgroundcolor; backgroundcolor = new Color(red, green, blue); GraphicsDevice.Clear(backgroundColor); base.draw(gametime);

88 Each time Mrs. Update is called and her phone rings, he is told to do her job. NOTE: Mrs. Update represents the Update Method in our current Moodlight project we are working on. **compare to current code** Mrs. Update s job requires her to access the 3 color values on the table, update the values (in the case of our program, add one to each value). Once done, Mrs. Update sits down and waits for her next call.

89 protected override void Update(GameTime gametime) { red++; green++; blue++; } base.update(gametime);

90 Special note about Mr. Draw and Mrs. Update: in our Moodlight program, they are called to do their job every sixtieth of a second.

91 The three values on the table: red, green, and blue are all values that Mr. Draw, Mrs. Update, and any other employees in the office can change or use. As a result, these represent the global variables/objects of our program the variables/objects that all METHODS can access and change!

92

93 I can Convert numbers between binary and decimal Use basic mathematics in a programming language. Define what the word assignment means in a programming language.

94 17093

95 s 1000s 100s 10s 1s

96 s 1000s 100s 10s 1s

97 s 2 4 8s 2 3 4s 2 2 2s 2 1 1s 2 0

98 Add together each power of 2 that is used to create the binary number! = is the same as 205 in our decimal number system

99 CONVERT THE FOLLOWING FROM BINARY INTO DECIMAL. 1) ) ) ) ) 111 7) ) )

100 CHECK YOUR ANSWERS! 1) ) ) ) ) ) ) )

101 93

102 CONVERT THE FOLLOWING FROM DECIMAL INTO BINARY. 1) 17 5) 108 2) 40 6) 96 3) 64 7) 72 4) 29 8) 9

103 CHECK YOUR ANSWER 1) ) ) ) ) ) ) )

104

105 Run the Program we created yesterday What do you notice happening?

106 Do you notice the program fades from black to white and then ABRUPTLY changes to black again?

107 red++; // green++; // blue++; What do you notice?

108 Remember red, blue, and green are BYTE variables something special is happening here To understand Byte s we need to understand binary!

109 Bit = 1 single 1 or 0 Byte = holds 8 bits! Byte biggest number: Convert this into decimal!!

110 = 255 in decimal When goes to But our byte value only looks at 8 bits So the value returns to 0 restarts the count! **This is why your color abruptly changes back to the beginning in your program!**

111 Integer: Double: +: = 9 -: 9 11 = -2 *: 2*3 = 6 +: = 5.5 -: = 2.5 *: 4*3.3 = 13.2 Some math behaves exactly as you expect!

112 Integer: Double: /: 14/4 = 3 % 14%4 = 2 (% = called modulus) /: 12.4/4 = 3.1 Some math does not behave as expected!!

113 Integer Math = Integer Answer Double Math (Decimal) = Decimal Answer / AND % BOTH NEEDED! / = # of times number goes in % = remainder after divide Can be decimal answer so modulus not needed

114 Integer Math: Double Math (Decimal): 16/5 = 16.0/5.0 = 16%5 =

115 1) 12.5/6 = 2) 16/4 = 3) 16/5 = 4) 16%5 = 5) 25/9 = 6) 25%9 = 7) 10%4 = 8) 16.0/6 = 9) 20%7 = 10) 62/8 =

116 1) 12.5/6 = ) 16/4 = 4 3) 16/5 = 3 4) 16%5 = 1 5) 25/9 = 2 6) 25%9 = 7 7) 10%4 = 2 8) 16.0/6 = ) 20%7 = 6 10) 62/8 = 7

117 P E M/D % A/S

118 *If two integers, assume integer mathematics* 1) 4*(3 6)^ ) 0.5*6(18%4)^ ) 16/4*5/10*6%7 4) 5*4 17% /5*10 2^2 5) 48/(4-6)^ %5*2

119 1. num++; 2. num--; 3. num += 3; 4. num *= 2; 5. num /= 5; 6. num -= 6;

120 1. num++; 2. num--; 3. num +=3; 4. num *=2; 5. num /=5; 6. num -=6; num = num + 1 num = num 1 num = num + 3 num = num*2 num = num/5 num = num - 6

121 1. num++; 2. num--; 3. num += 3; 4. num *= 2; 5. num /= 5; 6. num -= 6; num = num + 1 num = num 1 num = num + 3 num = num*2 num = num/5 num = num

122 When we store a value in a variable! Symbol: = THIS = IS NOT LIKE THE EQUALS SIGN IN MATH.IT MEANS ASSIGNMENT!!!

123 Used to Assign (and rewrite) variable values The value on the right is ASSIGNED to the value on the left Ex: int number; number = 4; number = 4*5 6; assignment reassigned 14 = number; invalid number + 5 = 6; invalid

124 int num1; int num2; num1 = 4 + 5; print num1; num2 = num1; print num2; num1 = num1 + 1; print num1; num2 = num1 + num2; print num2;

125 Trace the following int x; int y; int z; x = 3*4 2; y = x 6; z = x + y x = z*3 y = x + z z = x 10 x = y 10 At the End of this program what are the values of x, y, and z equal to?

126

127 I can Evaluate boolean expressions Use conditional statements in game design

128 A graphical representation of an algorithm (or portion of an algorithm) All actions are connected with arrows to show the flow of action 3 different control structures to represent different types of flow 1) Sequential 2) Selection 3) Repetition

129 Sequential (Linear) ONE flow **basic programs**

130 Selection (Decision) Split at Decisions - multiple paths Single selection: If Then Double selection: If Else Multiple Selection: If ElseIf Else

131 Repetition (Looping) repeat code Game Loop: Update & Draw Repeated 60 times a second! (We won t code looping automatic in game design!)

132 An expression that evaluates to: TRUE or FALSE Used to make DECISIONS in code Based on comparisons using relationship operators (next slide)

133 !=!= NOTE: EVALUATE TO TRUE OR FALSE!!!

134 TRUE OR FALSE: 1) x y > 0 2) 4*y == 30 3) y/x!= z 4) 22% 5 > 1 5) x*z >= y*z 6) z < 2*2 6 7) y*z!= 5*(-4) 8) 27%7 <= 5

135 TRUE OR FALSE: 1) x y > 0 False 2) 4*y == 30 False 3) y/x!= z True 4) 22% 5 > 1 True 5) x*z >= y*z True 6) z < 2*2 6 False 7) y*z!= 5*(-4) False 8) 27%7 <= 5 False

136 Single Selection Statements: If Then Flow Chart

137 If (<Boolean condition>) { <action 1>;. <action n>; }

138 ARE THESE VALID LINES OF CODE?!? X = 4 Y = -3 Z = 2 1) If (x*z > =5) 2) If( x + y + z ) 3) If( x*y = -12) 4) If(x*y!= z) 5) If( x*y > 0) { x = y + 4; } 6) If (z > 0) { z = x*y }

139 ARE THESE VALID LINES OF CODE?!? X = 4 Y = -3 Z = 2 1) If (x*z > =5) Valid 2) If( x + y + z ) Invalid 3) If( x*y = -12) Invalid 4) If(x*y!= z) Valid 5) If( x*y > 0) Valid { x = y + 4; } 6) If (z > 0) Invalid { z = x*y(;) }

140 Now: Double Selection Statements If Else Flow Chart:

141 If (<Boolean condition>) { <action(s) when True>; } Else { <action(s) when False>; }

142 When MORE than 2 possibilities If If Else Else Statements Flow Chart (complicated ) Will check conditions until finds FIRST condition it meets then skips remainder of conditional.

143 If (<first boolean condition>) {<first action(s)>;} else if(<second boolean condition>) {<second action(s)>;} else if(<third boolean condition>) else {<nth action(s)>;}

144 If (r > 80) {Print B ;} else if(r > 70) {Print C ;} else if(r > 90) {Print A ;} else {Print Need Improvement ;} Data a) r = 75 b) r = 55 c) r = 94 d) r = 82 e) r = 10

145 Count Up Hit 255 Count Down Hit 0 Come up with an algorithm for how we could repeat this for our mood light!

146 Use a new type of variable to track if counting up or down! bool redcountup When redintensity reaches 255 redcountup set to false When redintensity reaches 0 redcountup set to true When redcountup True increase redintensity, otherwise decrease

147 After define and initialize byte variables: bool redcountup = true; (can declare and initialize in the same line!)

148 protected override void Update(GameTime gametime) { if(gamepad.getstate(.)exit(); red++; remove this line green++; blue++;

149 if(red == 255) { redcountup = false; } if(red == 0) { redcountup = true; }

150 } if(redcountup == false) { red++; } Else { red--; } base.update(gametime);

151

152 I can Describe the game loop and trace through code mimicking the game loop.

153

154

155

XNA Workshop at CS&IT Symposium 7/11/11

XNA Workshop at CS&IT Symposium 7/11/11 XNA Workshop at CS&IT Symposium 7/11/11 Time 9:00 to 9:20 9:20 to 9:40 9:40 to 10:10 Mood Light 10:15 to 10:45 Manual Mood Light 10:50 to 11:20 Placing and Moving Image 11:25 to 11:45 Windows Phone Touch

More information

Unit 5 Test Review Name: Hour: Date: 1) Describe two ways we have used paint to help us as we studied images in monogame.

Unit 5 Test Review Name: Hour: Date: 1) Describe two ways we have used paint to help us as we studied images in monogame. Unit 5 Test Review Name: Hour: Date: Answer the following questions in complete sentences. 1) Describe two ways we have used paint to help us as we studied images in monogame. a) b) 2) Where do you DECLARE

More information

Programs, Data, and Pretty Colors

Programs, Data, and Pretty Colors C02625228.fm Page 19 Saturday, January 19, 2008 8:36 PM Chapter 2 Programs, Data, and Pretty Colors In this chapter: Introduction...........................................................19 Making a Game

More information

7/8/10 KEY CONCEPTS. Problem COMP 10 EXPLORING COMPUTER SCIENCE. Algorithm. Lecture 2 Variables, Types, and Programs. Program PROBLEM SOLVING

7/8/10 KEY CONCEPTS. Problem COMP 10 EXPLORING COMPUTER SCIENCE. Algorithm. Lecture 2 Variables, Types, and Programs. Program PROBLEM SOLVING KEY CONCEPTS COMP 10 EXPLORING COMPUTER SCIENCE Lecture 2 Variables, Types, and Programs Problem Definition of task to be performed (by a computer) Algorithm A particular sequence of steps that will solve

More information

GAME:IT Advanced. C# XNA Bouncing Ball First Game Part 1

GAME:IT Advanced. C# XNA Bouncing Ball First Game Part 1 GAME:IT Advanced C# XNA Bouncing Ball First Game Part 1 Objectives By the end of this lesson, you will have learned about and will be able to apply the following XNA Game Studio 4.0 concepts. Intro XNA

More information

Lesson 3: Basic Programming Concepts

Lesson 3: Basic Programming Concepts 3 ICT Gaming Essentials Lesson 3: Basic Programming Concepts LESSON SKILLS After completing this lesson, you will be able to: Explain the types and uses of variables and operators in game programming.

More information

XNA 4.0 RPG Tutorials. Part 2. More Core Game Components

XNA 4.0 RPG Tutorials. Part 2. More Core Game Components XNA 4.0 RPG Tutorials Part 2 More Core Game Components I'm writing these tutorials for the new XNA 4.0 framework. The tutorials will make more sense if they are read in order. You can find the list of

More information

Session 5.1. Writing Text

Session 5.1. Writing Text 1 Session 5.1 Writing Text Chapter 5.1: Writing Text 2 Session Overview Show how fonts are managed in computers Discover the difference between bitmap fonts and vector fonts Find out how to create font

More information

XNA Game Studio 4.0.

XNA Game Studio 4.0. Getting Started XNA Game Studio 4.0 To download XNA Game Studio 4.0 itself, go to http://www.microsoft.com/download/en/details.aspx?id=23714 XNA Game Studio 4.0 needs the Microsoft Visual Studio 2010 development

More information

CAMBRIDGE SCHOOL, NOIDA ASSIGNMENT 1, TOPIC: C++ PROGRAMMING CLASS VIII, COMPUTER SCIENCE

CAMBRIDGE SCHOOL, NOIDA ASSIGNMENT 1, TOPIC: C++ PROGRAMMING CLASS VIII, COMPUTER SCIENCE CAMBRIDGE SCHOOL, NOIDA ASSIGNMENT 1, TOPIC: C++ PROGRAMMING CLASS VIII, COMPUTER SCIENCE a) Mention any 4 characteristic of the object car. Ans name, colour, model number, engine state, power b) What

More information

[ the academy_of_code] Senior Beginners

[ the academy_of_code] Senior Beginners [ the academy_of_code] Senior Beginners 1 Drawing Circles First step open Processing Open Processing by clicking on the Processing icon (that s the white P on the blue background your teacher will tell

More information

A Summoner's Tale MonoGame Tutorial Series. Chapter 13. Leveling Up

A Summoner's Tale MonoGame Tutorial Series. Chapter 13. Leveling Up A Summoner's Tale MonoGame Tutorial Series Chapter 13 Leveling Up This tutorial series is about creating a Pokemon style game with the MonoGame Framework called A Summoner's Tale. The tutorials will make

More information

XNA (2D) Tutorial. Pong IAT410

XNA (2D) Tutorial. Pong IAT410 XNA (2D) Tutorial Pong IAT410 Creating a new project 1. From the Start Menu, click All Programs, then the Microsoft XNA Game Studio Express folder, and finally XNA Game Studio Express. 2. When the Start

More information

A Summoner's Tale MonoGame Tutorial Series. Chapter 9. Conversations Continued

A Summoner's Tale MonoGame Tutorial Series. Chapter 9. Conversations Continued A Summoner's Tale MonoGame Tutorial Series Chapter 9 Conversations Continued This tutorial series is about creating a Pokemon style game with the MonoGame Framework called A Summoner's Tale. The tutorials

More information

Slides adapted from 4week course at Cornell by Tom Roeder

Slides adapted from 4week course at Cornell by Tom Roeder Slides adapted from 4week course at Cornell by Tom Roeder Interactive Game loop Interactive Game Loop Core Mechanics Physics, AI, etc. Update() Input GamePad, mouse, keybard, other Update() Render changes

More information

Bits and Bytes. How do computers compute?

Bits and Bytes. How do computers compute? Bits and Bytes How do computers compute? Representing Data All data can be represented with: 1s and 0s on/of true/false Numbers? Five volunteers... Binary Numbers Positional Notation Binary numbers use

More information

Control Flow. COMS W1007 Introduction to Computer Science. Christopher Conway 3 June 2003

Control Flow. COMS W1007 Introduction to Computer Science. Christopher Conway 3 June 2003 Control Flow COMS W1007 Introduction to Computer Science Christopher Conway 3 June 2003 Overflow from Last Time: Why Types? Assembly code is typeless. You can take any 32 bits in memory, say this is an

More information

Fundamentals of Programming CS-110. Lecture 2

Fundamentals of Programming CS-110. Lecture 2 Fundamentals of Programming CS-110 Lecture 2 Last Lab // Example program #include using namespace std; int main() { cout

More information

Course Outline. Introduction to java

Course Outline. Introduction to java Course Outline 1. Introduction to OO programming 2. Language Basics Syntax and Semantics 3. Algorithms, stepwise refinements. 4. Quiz/Assignment ( 5. Repetitions (for loops) 6. Writing simple classes 7.

More information

What we will do today Explain and look at examples of. Programs that examine data. Data types. Topic 4. variables. expressions. assignment statements

What we will do today Explain and look at examples of. Programs that examine data. Data types. Topic 4. variables. expressions. assignment statements Topic 4 Variables Once a programmer has understood the use of variables, he has understood the essence of programming -Edsger Dijkstra What we will do today Explain and look at examples of primitive data

More information

Creating a Role Playing Game with XNA Game Studio 3.0 Part 4 Adding the Action Screen and Tile Engine

Creating a Role Playing Game with XNA Game Studio 3.0 Part 4 Adding the Action Screen and Tile Engine Creating a Role Playing Game with XNA Game Studio 3.0 Part 4 Adding the Action Screen and Tile Engine To follow along with this tutorial you will have to have read the previous tutorials to understand

More information

The C++ Language. Arizona State University 1

The C++ Language. Arizona State University 1 The C++ Language CSE100 Principles of Programming with C++ (based off Chapter 2 slides by Pearson) Ryan Dougherty Arizona State University http://www.public.asu.edu/~redoughe/ Arizona State University

More information

Loops (while and for)

Loops (while and for) Loops (while and for) CSE 1310 Introduction to Computers and Programming Alexandra Stefan 1 Motivation Was there any program we did (class or hw) where you wanted to repeat an action? 2 Motivation Name

More information

Midterms Save the Dates!

Midterms Save the Dates! University of British Columbia CPSC 111, Intro to Computation Alan J. Hu Primitive Data Types Arithmetic Operators Readings Your textbook is Big Java (3rd Ed). This Week s Reading: Ch 2.1-2.5, Ch 4.1-4.2.

More information

3 The L oop Control Structure

3 The L oop Control Structure 3 The L oop Control Structure Loops The while Loop Tips and Traps More Operators The for Loop Nesting of Loops Multiple Initialisations in the for Loop The Odd Loop The break Statement The continue Statement

More information

CSCI 1100L: Topics in Computing Lab Lab 11: Programming with Scratch

CSCI 1100L: Topics in Computing Lab Lab 11: Programming with Scratch CSCI 1100L: Topics in Computing Lab Lab 11: Programming with Scratch Purpose: We will take a look at programming this week using a language called Scratch. Scratch is a programming language that was developed

More information

BASIC ELEMENTS OF A COMPUTER PROGRAM

BASIC ELEMENTS OF A COMPUTER PROGRAM BASIC ELEMENTS OF A COMPUTER PROGRAM CSC128 FUNDAMENTALS OF COMPUTER PROBLEM SOLVING LOGO Contents 1 Identifier 2 3 Rules for naming and declaring data variables Basic data types 4 Arithmetic operators

More information

UNIT 5. String Functions and Random Numbers

UNIT 5. String Functions and Random Numbers UNIT 5 String Functions and Random Numbers DAY 1 String data type String storage in data String indexing I can.. Explain the purpose of the string variable type and how it is stored in memory. Explain

More information

VISUAL BASIC 6.0 OVERVIEW

VISUAL BASIC 6.0 OVERVIEW VISUAL BASIC 6.0 OVERVIEW GENERAL CONCEPTS Visual Basic is a visual programming language. You create forms and controls by drawing on the screen rather than by coding as in traditional languages. Visual

More information

Assoc. Prof. Dr. Marenglen Biba. (C) 2010 Pearson Education, Inc. All rights reserved.

Assoc. Prof. Dr. Marenglen Biba. (C) 2010 Pearson Education, Inc. All rights reserved. Assoc. Prof. Dr. Marenglen Biba Before writing a program to solve a problem, have a thorough understanding of the problem and a carefully planned approach to solving it. Understand the types of building

More information

Variables and Constants

Variables and Constants 87 Chapter 5 Variables and Constants 5.1 Storing Information in the Computer 5.2 Declaring Variables 5.3 Inputting Character Strings 5.4 Mistakes in Programs 5.5 Inputting Numbers 5.6 Inputting Real Numbers

More information

UNIT 1. Variables Binary Math

UNIT 1. Variables Binary Math UNIT 1 Variables Binary Math DAY 1 History of Computers Variables and Assignment I can.. Identify important inventions and people in the history of computers. Explain the purpose of a variable in computer

More information

SCRATCH MODULE 3: NUMBER CONVERSIONS

SCRATCH MODULE 3: NUMBER CONVERSIONS SCRATCH MODULE 3: NUMBER CONVERSIONS INTRODUCTION The purpose of this module is to experiment with user interactions, error checking input, and number conversion algorithms in Scratch. We will be exploring

More information

Game keystrokes or Calculates how fast and moves a cartoon Joystick movements how far to move a cartoon figure on screen figure on screen

Game keystrokes or Calculates how fast and moves a cartoon Joystick movements how far to move a cartoon figure on screen figure on screen Computer Programming Computers can t do anything without being told what to do. To make the computer do something useful, you must give it instructions. You can give a computer instructions in two ways:

More information

Introduction to the C++ Programming Language

Introduction to the C++ Programming Language LESSON SET 2 Introduction to the C++ Programming Language OBJECTIVES FOR STUDENT Lesson 2A: 1. To learn the basic components of a C++ program 2. To gain a basic knowledge of how memory is used in programming

More information

Creating Breakout - Part 2

Creating Breakout - Part 2 Creating Breakout - Part 2 Adapted from Basic Projects: Game Maker by David Waller So the game works, it is a functioning game. It s not very challenging though, and it could use some more work to make

More information

DEPARTMENT OF MATHS, MJ COLLEGE

DEPARTMENT OF MATHS, MJ COLLEGE T. Y. B.Sc. Mathematics MTH- 356 (A) : Programming in C Unit 1 : Basic Concepts Syllabus : Introduction, Character set, C token, Keywords, Constants, Variables, Data types, Symbolic constants, Over flow,

More information

Lecture 2. Examples of Software. Programming and Data Structure. Programming Languages. Operating Systems. Sudeshna Sarkar

Lecture 2. Examples of Software. Programming and Data Structure. Programming Languages. Operating Systems. Sudeshna Sarkar Examples of Software Programming and Data Structure Lecture 2 Sudeshna Sarkar Read an integer and determine if it is a prime number. A Palindrome recognizer Read in airline route information as a matrix

More information

2SKILL. Variables Lesson 6. Remembering numbers (and other stuff)...

2SKILL. Variables Lesson 6. Remembering numbers (and other stuff)... Remembering numbers (and other stuff)... Let s talk about one of the most important things in any programming language. It s called a variable. Don t let the name scare you. What it does is really simple.

More information

Python Games. Session 1 By Declan Fox

Python Games. Session 1 By Declan Fox Python Games Session 1 By Declan Fox Rules General Information Wi-Fi Name: CoderDojo Password: coderdojowireless Website: http://cdathenry.wordpress.com/ Plans for this year Command line interface at first

More information

XNA 4.0 RPG Tutorials. Part 5. The Tile Engine - Part 2

XNA 4.0 RPG Tutorials. Part 5. The Tile Engine - Part 2 XNA 4.0 RPG Tutorials Part 5 The Tile Engine - Part 2 I'm writing these tutorials for the new XNA 4.0 framework. The tutorials will make more sense if they are read in order. You can find the list of tutorials

More information

Unit-II Programming and Problem Solving (BE1/4 CSE-2)

Unit-II Programming and Problem Solving (BE1/4 CSE-2) Unit-II Programming and Problem Solving (BE1/4 CSE-2) Problem Solving: Algorithm: It is a part of the plan for the computer program. An algorithm is an effective procedure for solving a problem in a finite

More information

CSCI 161 Introduction to Computer Science

CSCI 161 Introduction to Computer Science CSCI 161 Introduction to Computer Science Department of Mathematics and Computer Science Lecture 2b A First Look at Class Design Last Time... We saw: How fields (instance variables) are declared How methods

More information

GCSE Computer Science Booster Pack

GCSE Computer Science Booster Pack GCSE Computer Science Booster Pack Commissioned by The PiXL Club Ltd. This resource is strictly for the use of member schools for as long as they remain members of The PiXL Club. It may not be copied,

More information

IWKS 3400 Lab 3 1 JK Bennett

IWKS 3400 Lab 3 1 JK Bennett IWKS 3400 Lab 3 1 JK Bennett This lab consists of four parts, each of which demonstrates an aspect of 2D game development. Each part adds functionality. You will first just put a sprite on the screen;

More information

AN INTRODUCTION TO SCRATCH (2) PROGRAMMING

AN INTRODUCTION TO SCRATCH (2) PROGRAMMING AN INTRODUCTION TO SCRATCH (2) PROGRAMMING Document Version 2 (04/10/2014) INTRODUCTION SCRATCH is a visual programming environment and language. It was launched by the MIT Media Lab in 2007 in an effort

More information

Last Time. University of British Columbia CPSC 111, Intro to Computation Alan J. Hu. Readings

Last Time. University of British Columbia CPSC 111, Intro to Computation Alan J. Hu. Readings University of British Columbia CPSC 111, Intro to Computation Alan J. Hu Writing a Simple Java Program Intro to Variables Readings Your textbook is Big Java (3rd Ed). This Week s Reading: Ch 2.1-2.5, Ch

More information

Java How to Program, 9/e. Copyright by Pearson Education, Inc. All Rights Reserved.

Java How to Program, 9/e. Copyright by Pearson Education, Inc. All Rights Reserved. Java How to Program, 9/e Copyright 1992-2012 by Pearson Education, Inc. All Rights Reserved. Copyright 1992-2012 by Pearson Copyright 1992-2012 by Pearson Before writing a program to solve a problem, have

More information

Slides built from Carter Chapter 10

Slides built from Carter Chapter 10 Slides built from Carter Chapter 10 Animating Sprites (textures) Images from wikipedia.org Animating Sprites (textures) Images from wikipedia.org Lets Add to Our XELibrary Going to add a CelAnimationManager

More information

CS 135 Lab Assignments Week 1

CS 135 Lab Assignments Week 1 CS 135 Lab Assignments Week 1 Professor: Matt B. Pedersen This handout is the assignment that you must finish for the lab portion of the course in week 1. You must finish the assignments yourself; if you

More information

University of Technology. Laser & Optoelectronics Engineering Department. C++ Lab.

University of Technology. Laser & Optoelectronics Engineering Department. C++ Lab. University of Technology Laser & Optoelectronics Engineering Department C++ Lab. Second week Variables Data Types. The usefulness of the "Hello World" programs shown in the previous section is quite questionable.

More information

Chapter 2 Using Data. Instructor s Manual Table of Contents. At a Glance. A Guide to this Instructor s Manual:

Chapter 2 Using Data. Instructor s Manual Table of Contents. At a Glance. A Guide to this Instructor s Manual: Java Programming, Eighth Edition 2-1 Chapter 2 Using Data A Guide to this Instructor s Manual: We have designed this Instructor s Manual to supplement and enhance your teaching experience through classroom

More information

Selec%on and Decision Structures in Java: If Statements and Switch Statements CSC 121 Fall 2016 Howard Rosenthal

Selec%on and Decision Structures in Java: If Statements and Switch Statements CSC 121 Fall 2016 Howard Rosenthal Selec%on and Decision Structures in Java: If Statements and Switch Statements CSC 121 Fall 2016 Howard Rosenthal Lesson Goals Understand Control Structures Understand how to control the flow of a program

More information

Selec%on and Decision Structures in Java: If Statements and Switch Statements CSC 121 Spring 2016 Howard Rosenthal

Selec%on and Decision Structures in Java: If Statements and Switch Statements CSC 121 Spring 2016 Howard Rosenthal Selec%on and Decision Structures in Java: If Statements and Switch Statements CSC 121 Spring 2016 Howard Rosenthal Lesson Goals Understand Control Structures Understand how to control the flow of a program

More information

Variables and Functions. ROBOTC Software

Variables and Functions. ROBOTC Software Variables and Functions ROBOTC Software Variables A variable is a space in your robots memory where data can be stored, including whole numbers, decimal numbers, and words Variable names follow the same

More information

Session 5.2. Creating Clocks

Session 5.2. Creating Clocks 1 Session 5.2 Creating Clocks Chapter 5.2: Creating Clocks 2 Session Overview Find out how to obtain and use the current date and time in a C# program using the DateTime type Discover how to extract a

More information

Mobile Computing Professor Pushpendra Singh Indraprastha Institute of Information Technology Delhi Java Basics Lecture 02

Mobile Computing Professor Pushpendra Singh Indraprastha Institute of Information Technology Delhi Java Basics Lecture 02 Mobile Computing Professor Pushpendra Singh Indraprastha Institute of Information Technology Delhi Java Basics Lecture 02 Hello, in this lecture we will learn about some fundamentals concepts of java.

More information

ADARSH VIDYA KENDRA NAGERCOIL COMPUTER SCIENCE. Grade: IX C++ PROGRAMMING. Department of Computer Science 1

ADARSH VIDYA KENDRA NAGERCOIL COMPUTER SCIENCE. Grade: IX C++ PROGRAMMING. Department of Computer Science 1 NAGERCOIL COMPUTER SCIENCE Grade: IX C++ PROGRAMMING 1 C++ 1. Object Oriented Programming OOP is Object Oriented Programming. It was developed to overcome the flaws of the procedural approach to programming.

More information

CHAPTER 3: FUNDAMENTAL OF SOFTWARE ENGINEERING FOR GAMES.

CHAPTER 3: FUNDAMENTAL OF SOFTWARE ENGINEERING FOR GAMES. CHAPTER 3: FUNDAMENTAL OF SOFTWARE ENGINEERING FOR GAMES www.asyrani.com TOPICS COVERED C++ Review and Best Practices Data, Code, and Memory in C++ Catching and Handling Errors C++ REVIEW AND BEST PRACTICES

More information

BB4W. KS3 Programming Workbook INTRODUCTION TO. BBC BASIC for Windows. Name: Class:

BB4W. KS3 Programming Workbook INTRODUCTION TO. BBC BASIC for Windows. Name: Class: KS3 Programming Workbook INTRODUCTION TO BB4W BBC BASIC for Windows Name: Class: Resource created by Lin White www.coinlea.co.uk This resource may be photocopied for educational purposes Introducing BBC

More information

Pick a number. Conditionals. Boolean Logic Relational Expressions Logical Operators Numerical Representation Binary. CS Conditionals 1

Pick a number. Conditionals. Boolean Logic Relational Expressions Logical Operators Numerical Representation Binary. CS Conditionals 1 Conditionals Boolean Logic Relational Expressions Logical Operators Numerical Representation Binary CS105 04 Conditionals 1 Pick a number CS105 04 Conditionals 2 Boolean Expressions An expression that

More information

Darrell Bethea May 25, 2011

Darrell Bethea May 25, 2011 Darrell Bethea May 25, 2011 Yesterdays slides updated Midterm on tomorrow in SN014 Closed books, no notes, no computer Program 3 due Tuesday 2 3 A whirlwind tour of almost everything we have covered so

More information

C-1. Overview. CSE 142 Computer Programming I. Review: Computer Organization. Review: Memory. Declaring Variables. Memory example

C-1. Overview. CSE 142 Computer Programming I. Review: Computer Organization. Review: Memory. Declaring Variables. Memory example CSE 142 Computer Programming I Variables Overview Concepts this lecture: Variables Declarations Identifiers and Reserved Words Types Expressions Assignment statement Variable initialization 2000 UW CSE

More information

Introduction to Programming EC-105. Lecture 2

Introduction to Programming EC-105. Lecture 2 Introduction to Programming EC-105 Lecture 2 Input and Output A data stream is a sequence of data - Typically in the form of characters or numbers An input stream is data for the program to use - Typically

More information

C++ Programming: From Problem Analysis to Program Design, Third Edition

C++ Programming: From Problem Analysis to Program Design, Third Edition C++ Programming: From Problem Analysis to Program Design, Third Edition Chapter 2: Basic Elements of C++ Objectives (continued) Become familiar with the use of increment and decrement operators Examine

More information

Asteroid Destroyer How it Works

Asteroid Destroyer How it Works Asteroid Destroyer How it Works This is a summary of some of the more advance coding associated with the Asteroid Destroyer Game. Many of the events with in the game are common sense other than the following

More information

2. Numbers In, Numbers Out

2. Numbers In, Numbers Out COMP1917: Computing 1 2. Numbers In, Numbers Out Reading: Moffat, Chapter 2. COMP1917 15s2 2. Numbers In, Numbers Out 1 The Art of Programming Think about the problem Write down a proposed solution Break

More information

Assignment 4: Dodo gets smarter

Assignment 4: Dodo gets smarter Assignment 4: Dodo gets smarter Algorithmic Thinking and Structured Programming (in Greenfoot) 2017 Renske Smetsers-Weeda & Sjaak Smetsers 1 Contents Introduction 1 Learning objectives 1 Instructions 1

More information

Chapter-8 DATA TYPES. Introduction. Variable:

Chapter-8 DATA TYPES. Introduction. Variable: Chapter-8 DATA TYPES Introduction To understand any programming languages we need to first understand the elementary concepts which form the building block of that program. The basic building blocks include

More information

Chapter 1 Operations With Numbers

Chapter 1 Operations With Numbers Chapter 1 Operations With Numbers Part I Negative Numbers You may already know what negative numbers are, but even if you don t, then you have probably seen them several times over the past few days. If

More information

Reserved Words and Identifiers

Reserved Words and Identifiers 1 Programming in C Reserved Words and Identifiers Reserved word Word that has a specific meaning in C Ex: int, return Identifier Word used to name and refer to a data element or object manipulated by the

More information

Compile and run the code. You should see an empty window, cleared to a dark purple color.

Compile and run the code. You should see an empty window, cleared to a dark purple color. IWKS 3400 LAB 10 1 JK Bennett This lab will introduce most of the techniques required to construct flight simulator style game. Our primary goal is to demonstrate various techniques in the MonoGame environment,

More information

GBL Language Reference Manual

GBL Language Reference Manual COMS W4115 PROGRAMMING LANGUAGES AND TRANSLATORS GBL Language Reference Manual Yiqing Cui(yc3121) Sihao Zhang(sz2558) Ye Cao(yc3113) Shengtong Zhang(sz2539) March 7, 2016 CONTENTS 1 Introduction 3 2 Syntax

More information

We will start our journey into Processing with creating static images using commands available in Processing:

We will start our journey into Processing with creating static images using commands available in Processing: Processing Notes Chapter 1: Starting Out We will start our journey into Processing with creating static images using commands available in Processing: rect( ) line ( ) ellipse() triangle() NOTE: to find

More information

Chapter 6 Reacting to Player Input

Chapter 6 Reacting to Player Input Chapter 6 Reacting to Player Input 6.1 Introduction In this chapter, we will show you how your game program can react to mouse clicks and button presses. In order to do this, we need a instruction called

More information

Exercise: Inventing Language

Exercise: Inventing Language Memory Computers get their powerful flexibility from the ability to store and retrieve data Data is stored in main memory, also known as Random Access Memory (RAM) Exercise: Inventing Language Get a separate

More information

Introduction to C# Applications

Introduction to C# Applications 1 2 3 Introduction to C# Applications OBJECTIVES To write simple C# applications To write statements that input and output data to the screen. To declare and use data of various types. To write decision-making

More information

Collision Detection Concept

Collision Detection Concept Collision Detection Collision Detection Concept When two fireflies collide we tag them for removal and add an explosion to the blasts list. The position and velocity of the explosion is set to the average

More information

CMPSCI 187 / Spring 2015 Hangman

CMPSCI 187 / Spring 2015 Hangman CMPSCI 187 / Spring 2015 Hangman Due on February 12, 2015, 8:30 a.m. Marc Liberatore and John Ridgway Morrill I N375 Section 01 @ 10:00 Section 02 @ 08:30 1 CMPSCI 187 / Spring 2015 Hangman Contents Overview

More information

Creating Java Programs with Greenfoot

Creating Java Programs with Greenfoot Creating Java Programs with Greenfoot Working with Source Code and Documentation 1 Copyright 2012, Oracle and/or its affiliates. All rights Objectives This lesson covers the following topics: Demonstrate

More information

TOPIC 2 INTRODUCTION TO JAVA AND DR JAVA

TOPIC 2 INTRODUCTION TO JAVA AND DR JAVA 1 TOPIC 2 INTRODUCTION TO JAVA AND DR JAVA Notes adapted from Introduction to Computing and Programming with Java: A Multimedia Approach by M. Guzdial and B. Ericson, and instructor materials prepared

More information

Lines of Symmetry. Grade 3. Amy Hahn. Education 334: MW 8 9:20 a.m.

Lines of Symmetry. Grade 3. Amy Hahn. Education 334: MW 8 9:20 a.m. Lines of Symmetry Grade 3 Amy Hahn Education 334: MW 8 9:20 a.m. GRADE 3 V. SPATIAL SENSE, GEOMETRY AND MEASUREMENT A. Spatial Sense Understand the concept of reflection symmetry as applied to geometric

More information

Conditional Programming

Conditional Programming COMP-202 Conditional Programming Chapter Outline Control Flow of a Program The if statement The if - else statement Logical Operators The switch statement The conditional operator 2 Introduction So far,

More information

VARIABLES. Aim Understanding how computer programs store values, and how they are accessed and used in computer programs.

VARIABLES. Aim Understanding how computer programs store values, and how they are accessed and used in computer programs. Lesson 2 VARIABLES Aim Understanding how computer programs store values, and how they are accessed and used in computer programs. WHAT ARE VARIABLES? When you input data (i.e. information) into a computer

More information

VARIABLES. 1. STRINGS Data with letters and/or characters 2. INTEGERS Numbers without decimals 3. FLOATING POINT NUMBERS Numbers with decimals

VARIABLES. 1. STRINGS Data with letters and/or characters 2. INTEGERS Numbers without decimals 3. FLOATING POINT NUMBERS Numbers with decimals VARIABLES WHAT IS A VARIABLE? A variable is a storage location in the computer s memory, used for holding information while the program is running. The information that is stored in a variable may change,

More information

BoredGames Language Reference Manual A Language for Board Games. Brandon Kessler (bpk2107) and Kristen Wise (kew2132)

BoredGames Language Reference Manual A Language for Board Games. Brandon Kessler (bpk2107) and Kristen Wise (kew2132) BoredGames Language Reference Manual A Language for Board Games Brandon Kessler (bpk2107) and Kristen Wise (kew2132) 1 Table of Contents 1. Introduction... 4 2. Lexical Conventions... 4 2.A Comments...

More information

Conditional Statement

Conditional Statement Conditional Statement 1 Conditional Statements Allow different sets of instructions to be executed depending on truth or falsity of a logical condition Also called Branching How do we specify conditions?

More information

What did we talk about last time? Examples switch statements

What did we talk about last time? Examples switch statements Week 4 - Friday What did we talk about last time? Examples switch statements History of computers Hardware Software development Basic Java syntax Output with System.out.print() Mechanical Calculation

More information

Two Types of Types. Primitive Types in Java. Using Primitive Variables. Class #07: Java Primitives. Integer types.

Two Types of Types. Primitive Types in Java. Using Primitive Variables. Class #07: Java Primitives. Integer types. Class #07: Java Primitives Software Design I (CS 120): M. Allen, 13 Sep. 2018 Two Types of Types So far, we have mainly been dealing with objects, like DrawingGizmo, Window, Triangle, that are: 1. Specified

More information

Review: Exam 1. Your First C++ Program. Declaration Statements. Tells the compiler. Examples of declaration statements

Review: Exam 1. Your First C++ Program. Declaration Statements. Tells the compiler. Examples of declaration statements Review: Exam 1 9/20/06 CS150 Introduction to Computer Science 1 1 Your First C++ Program 1 //*********************************************************** 2 // File name: hello.cpp 3 // Author: Shereen Khoja

More information

Processing Assignment Write- Ups

Processing Assignment Write- Ups Processing Assignment Write- Ups Exercise 1-1 Processing is not an elaborate series of points like connect the dots or is it? Can t be cause I got it all wrong when I mapped out each and every point that

More information

CS112 Lecture: Variables, Expressions, Computation, Constants, Numeric Input-Output

CS112 Lecture: Variables, Expressions, Computation, Constants, Numeric Input-Output CS112 Lecture: Variables, Expressions, Computation, Constants, Numeric Input-Output Last revised January 12, 2006 Objectives: 1. To introduce arithmetic operators and expressions 2. To introduce variables

More information

CS 106 Introduction to Computer Science I

CS 106 Introduction to Computer Science I CS 106 Introduction to Computer Science I 05 / 31 / 2017 Instructor: Michael Eckmann Today s Topics Questions / Comments? recap and some more details about variables, and if / else statements do lab work

More information

Variables and Constants

Variables and Constants HOUR 3 Variables and Constants Programs need a way to store the data they use. Variables and constants offer various ways to work with numbers and other values. In this hour you learn: How to declare and

More information

C: How to Program. Week /Mar/05

C: How to Program. Week /Mar/05 1 C: How to Program Week 2 2007/Mar/05 Chapter 2 - Introduction to C Programming 2 Outline 2.1 Introduction 2.2 A Simple C Program: Printing a Line of Text 2.3 Another Simple C Program: Adding Two Integers

More information

Multiple Choice (Questions 1 13) 26 Points Select all correct answers (multiple correct answers are possible)

Multiple Choice (Questions 1 13) 26 Points Select all correct answers (multiple correct answers are possible) Name Closed notes, book and neighbor. If you have any questions ask them. Notes: Segment of code necessary C++ statements to perform the action described not a complete program Program a complete C++ program

More information

Erasmus+ Project: Yestermorrow Year 1 Maths: Pythagorean Theorem

Erasmus+ Project: Yestermorrow Year 1 Maths: Pythagorean Theorem Erasmus+ Project: Yestermorrow Year 1 Maths: Pythagorean Theorem Workshop (Coding Android Mobile Apps): Collision Detection and the Pythagorean Theorem (Based on the code.org worksheet) WORKSHOP OVERVIEW

More information

COP 3330 Final Exam Review

COP 3330 Final Exam Review COP 3330 Final Exam Review I. The Basics (Chapters 2, 5, 6) a. comments b. identifiers, reserved words c. white space d. compilers vs. interpreters e. syntax, semantics f. errors i. syntax ii. run-time

More information

Expressions and Data Types CSC 121 Fall 2015 Howard Rosenthal

Expressions and Data Types CSC 121 Fall 2015 Howard Rosenthal Expressions and Data Types CSC 121 Fall 2015 Howard Rosenthal Lesson Goals Understand the basic constructs of a Java Program Understand how to use basic identifiers Understand simple Java data types and

More information

XNA 4.0 RPG Tutorials. Part 3. Even More Core Game Components

XNA 4.0 RPG Tutorials. Part 3. Even More Core Game Components XNA 4.0 RPG Tutorials Part 3 Even More Core Game Components I'm writing these tutorials for the new XNA 4.0 framework. The tutorials will make more sense if they are read in order. You can find the list

More information