# SC DCS: H.4

## CodeHS Lessons

Write code that uses variables, events, functions, operators (i.e. arithmetic, relational, logical), conditional control structures (e.g., if, if-else) and repetition/iteration control structures (e.g., while, for)

 Standard 1.9 For Loops 1.11 If/Else Statements 1.12 While Loops 1.14 Control Structures Example 2.1 Challenge Problems 3.2 Variables 3.4 Basic Math 3.6 Random Numbers 6.1 Booleans 6.3 Logical Operators 6.4 Comparison Operators 6.6 While Loops 6.7 The Break Statement 6.9 For Loops 10.4 Mouse Click Events
 Standard 9.2 Variables 9.4 Basic Math in JavaScript 9.5 Booleans 9.6 Logical Operators 9.7 Comparison Operators 9.9 For Loops in JavaScript 9.10 For Loop Practice 9.11 Random Numbers 9.12 While Loops 9.13 Loop and a Half 9.14 Functions and Parameters 1 9.15 Functions and Parameters 2 9.16 Functions and Return Values 1 9.17 Functions and Return Values 2
 Standard 21.1 Challenge Problems 22.1 Booleans 22.2 Logical Operators 22.3 Comparison Operators 22.5 For Loops in JavaScript 22.7 For Loop Practice 22.8 Random Numbers 22.9 While Loops 22.10 Loop and a Half
 Standard 1.9 For Loops 1.11 If/Else Statements 1.12 While Loops 1.14 Control Structures Example 1.16 Challenge Problems 2.2 Variables 2.4 Basic Math 2.6 Random Numbers 5.1 Booleans 5.3 Logical Operators 5.4 Comparison Operators 5.6 While Loops 5.7 The Break Statement 5.9 For Loops 9.4 Mouse Click Events
 Standard 1.9 For Loops 1.11 If/Else Statements 1.12 While Loops 1.14 Control Structures Example 2.1 Challenge Problems 3.2 Variables 3.4 Basic Math 3.6 Random Numbers 6.1 Booleans 6.3 Logical Operators 6.4 Comparison Operators 6.6 While Loops 6.7 The Break Statement 6.9 For Loops 10.4 Mouse Click Events
 Standard 1.9 For Loops 1.11 If/Else Statements 1.12 While Loops 1.14 Control Structures Example 2.1 Challenge Problems 3.2 Variables 3.4 Basic Math 3.6 Random Numbers 6.1 Booleans 6.3 Logical Operators 6.4 Comparison Operators 6.6 While Loops 6.7 The Break Statement 6.9 For Loops 11.4 Mouse Click Events
 Standard 4.3 Booleans
 Standard 3.2 Variables 3.4 Basic Math in JavaScript
 Standard 1.9 For Loops 1.11 If/Else Statements 1.12 While Loops in Karel 1.13 Control Structures Example 2.1 Challenge Problems 3.2 Variables 3.4 Basic Math in JavaScript 6.1 Booleans 6.2 Logical Operators 6.3 Comparison Operators 6.5 For Loops in JavaScript 6.7 For Loop Practice 6.8 Random Numbers 6.9 While Loops 6.10 Loop and a Half 8.1 Functions and Parameters 1 8.2 Functions and Parameters 2 8.3 Functions and Parameters 3 8.4 Functions and Return Values 1 8.5 Functions and Return Values 2 11.5 Mouse Events: Mouse Clicked
 Standard 2.10 For Loops 2.12 If/Else Statements 2.13 While Loops in Karel 2.14 Control Structures Example 3.2 Challenge Problems 5.2 Variables 5.4 Basic Math in JavaScript 7.1 Booleans 7.2 Logical Operators 7.3 Comparison Operators 7.5 For Loops in JavaScript 7.7 For Loop Practice 7.9 While Loops 7.10 Loop and a Half 9.1 Functions and Parameters 1 9.2 Functions and Parameters 2 9.3 Functions and Parameters 3 9.4 Functions and Return Values 1 9.5 Functions and Return Values 2 9.10 Mouse Events: Mouse Clicked
 Standard 1.9 For Loops 1.11 If/Else Statements 1.12 While Loops in Karel 1.13 Control Structures Example 2.1 Challenge Problems 3.2 Variables 3.4 Basic Math in JavaScript 5.1 Booleans 5.2 Logical Operators 5.3 Comparison Operators 5.5 For Loops in JavaScript 5.7 For Loop Practice 5.8 Random Numbers 5.9 While Loops 5.10 Loop and a Half 7.1 Functions and Parameters 1 7.2 Functions and Parameters 2 7.3 Functions and Parameters 3 7.4 Functions and Return Values 1 7.5 Functions and Return Values 2 9.5 Mouse Events: Mouse Clicked
 Standard 1.9 For Loops 1.11 If/Else Statements 1.12 While Loops in Karel 1.13 Control Structures Example 2.1 Challenge Problems 3.2 Variables 3.4 Basic Math in JavaScript 5.1 Booleans 5.2 Logical Operators 5.3 Comparison Operators 5.5 For Loops in JavaScript 5.7 For Loop Practice 5.8 Random Numbers 5.9 While Loops 5.10 Loop and a Half 7.1 Functions and Parameters 1 7.2 Functions and Parameters 2 7.3 Functions and Parameters 3 7.4 Functions and Return Values 1 7.5 Functions and Return Values 2 9.5 Mouse Events: Mouse Clicked
 Standard 1.9 For Loops 1.11 If/Else Statements 1.12 While Loops in Karel 1.13 Control Structures Example 2.1 Challenge Problems 3.2 Variables 3.4 Basic Math in JavaScript 5.1 Booleans 5.2 Logical Operators 5.3 Comparison Operators 5.5 For Loops in JavaScript 5.7 For Loop Practice 5.8 Random Numbers 5.9 While Loops 5.10 Loop and a Half 7.1 Functions and Parameters 1 7.2 Functions and Parameters 2 7.3 Functions and Parameters 3 7.4 Functions and Return Values 1 7.5 Functions and Return Values 2
 Standard 14.2 Variables 14.4 Basic Math in JavaScript 14.5 Booleans 14.6 Logical Operators 14.7 Comparison Operators 14.9 For Loops in JavaScript 14.10 Functions and Parameters 1 14.11 Functions and Parameters 2 14.12 Functions and Return Values 1
 Standard 2.10 For Loops 2.12 If/Else Statements 2.13 While Loops in Karel 2.14 Control Structures Example 3.2 Challenge Problems 5.2 Variables 5.4 Basic Math in JavaScript 7.1 Booleans 7.2 Logical Operators 7.3 Comparison Operators 7.5 For Loops in JavaScript 7.7 For Loop Practice 7.8 Random Numbers 7.9 While Loops 7.10 Loop and a Half 9.1 Functions and Parameters 1 9.2 Functions and Parameters 2 9.3 Functions and Parameters 3 9.4 Functions and Return Values 1 9.5 Functions and Return Values 2 9.10 Mouse Events: Mouse Clicked
 Standard 2.10 For Loops 2.12 If/Else Statements 2.13 While Loops in Karel 2.14 Control Structures Example 3.2 Challenge Problems 6.3 Variables 6.5 Basic Math in JavaScript 8.1 Booleans 8.2 Logical Operators 8.3 Comparison Operators 8.5 For Loops in JavaScript 8.7 For Loop Practice 8.8 Random Numbers 8.9 While Loops 8.10 Loop and a Half 10.1 Functions and Parameters 1 10.2 Functions and Parameters 2 10.3 Functions and Parameters 3 10.4 Functions and Return Values 1 10.5 Functions and Return Values 2 10.11 Mouse Events: Mouse Clicked
 Standard 3.10 For Loops 3.12 If/Else Statements 3.13 While Loops in Karel 3.14 Control Structures Example 4.2 Challenge Problems 6.2 Variables 6.4 Basic Math in JavaScript 8.1 Booleans 8.2 Logical Operators 8.3 Comparison Operators 8.5 For Loops in JavaScript 8.7 For Loop Practice 8.8 Random Numbers 8.9 While Loops 8.10 Loop and a Half 10.1 Functions and Parameters 1 10.2 Functions and Parameters 2 10.3 Functions and Parameters 3 10.4 Functions and Return Values 1 10.5 Functions and Return Values 2 10.10 Mouse Events: Mouse Clicked
 Standard 2.10 For Loops 2.12 If/Else Statements 2.13 While Loops in Karel 2.14 Control Structures Example 3.2 Challenge Problems 5.2 Variables 5.4 Basic Math in JavaScript 7.1 Booleans 7.2 Logical Operators 7.3 Comparison Operators 7.5 For Loops in JavaScript 7.7 For Loop Practice 7.9 While Loops 7.10 Loop and a Half 9.1 Functions and Parameters 1 9.2 Functions and Parameters 2 9.3 Functions and Parameters 3 9.4 Functions and Return Values 1 9.5 Functions and Return Values 2 9.10 Mouse Events: Mouse Clicked
 Standard 2.10 For Loops 2.12 If/Else Statements 2.13 While Loops in Karel 2.14 Control Structures Example 3.2 Challenge Problems 5.2 Variables 5.4 Basic Math in JavaScript 7.1 Booleans 7.2 Logical Operators 7.3 Comparison Operators 7.5 For Loops in JavaScript 7.7 For Loop Practice 7.9 While Loops 7.10 Loop and a Half 9.1 Functions and Parameters 1 9.2 Functions and Parameters 2 9.3 Functions and Parameters 3 9.4 Functions and Return Values 1 9.5 Functions and Return Values 2 9.10 Mouse Events: Mouse Clicked
 Standard 2.10 For Loops 2.12 If/Else Statements 2.13 While Loops in Karel 2.14 Control Structures Example 3.2 Challenge Problems 6.2 Variables 6.4 Basic Math in JavaScript 9.1 Booleans 9.2 Logical Operators 9.3 Comparison Operators 9.5 For Loops in JavaScript 9.7 For Loop Practice 9.8 Random Numbers 9.9 While Loops 9.10 Loop and a Half 11.1 Functions and Parameters 1 11.2 Functions and Parameters 2 11.3 Functions and Parameters 3 11.4 Functions and Return Values 1 11.5 Functions and Return Values 2 11.10 Mouse Events: Mouse Clicked
 Standard 2.10 For Loops 2.12 If/Else Statements 2.13 While Loops in Karel 2.14 Control Structures Example 3.2 Challenge Problems 10.3 Variables 10.5 Basic Math in JavaScript 15.1 Booleans 15.2 Logical Operators 15.3 Comparison Operators 15.5 For Loops in JavaScript 15.7 For Loop Practice 15.8 Random Numbers 15.9 While Loops 15.10 Loop and a Half
 Standard 2.10 For Loops 2.12 If/Else Statements 2.13 While Loops in Karel 2.14 Control Structures Example 3.2 Challenge Problems 5.2 Variables 5.4 Basic Math in JavaScript 17.10 Mouse Events: Mouse Clicked 17.5 Functions and Return Values 2 17.4 Functions and Return Values 1 17.3 Functions and Parameters 3 17.2 Functions and Parameters 2 17.1 Functions and Parameters 1 14.10 Loop and a Half 14.9 While Loops 14.8 Random Numbers 14.7 For Loop Practice 14.5 For Loops in JavaScript 14.3 Comparison Operators 14.2 Logical Operators 14.1 Booleans
 Standard 2.10 For Loops 2.12 If/Else Statements 2.13 While Loops in Karel 2.14 Control Structures Example 3.2 Challenge Problems 5.2 Variables 5.4 Basic Math in JavaScript 7.1 Booleans 7.2 Logical Operators 7.3 Comparison Operators 7.5 For Loops in JavaScript 7.7 For Loop Practice 7.9 While Loops 7.10 Loop and a Half 9.1 Functions and Parameters 1 9.2 Functions and Parameters 2 9.3 Functions and Parameters 3 9.4 Functions and Return Values 1 9.5 Functions and Return Values 2 9.10 Mouse Events: Mouse Clicked
 Standard 1.9 For Loops 1.11 If/Else Statements 1.12 While Loops 1.14 Control Structures Example 2.2 Variables 2.4 Basic Math 2.6 Random Numbers 4.1 Booleans 4.3 Logical Operators 4.4 Comparison Operators 4.6 While Loops 4.7 The Break Statement 4.9 For Loops 6.4 Mouse Click Events 18.1 Challenge Problems
 Standard 1.9 For Loops 1.11 If/Else Statements 1.12 While Loops in Karel 1.13 Control Structures Example 2.1 Challenge Problems 8.3 Variables 8.5 Basic Math in JavaScript 10.1 Booleans 10.2 Logical Operators 10.3 Comparison Operators 10.5 For Loops in JavaScript 10.7 For Loop Practice 10.8 Random Numbers 10.9 While Loops 10.10 Loop and a Half 12.1 Functions and Parameters 1 12.2 Functions and Parameters 2 12.3 Functions and Parameters 3 12.4 Functions and Return Values 1 12.5 Functions and Return Values 2 21.5 Mouse Events: Mouse Clicked
 Standard 1.9 For Loops 1.11 If/Else Statements 1.12 While Loops in Karel 1.13 Control Structures Example 2.1 Challenge Problems 8.3 Variables 8.5 Basic Math in JavaScript 10.1 Booleans 10.2 Logical Operators 10.3 Comparison Operators 10.5 For Loops in JavaScript 10.7 For Loop Practice 10.8 Random Numbers 10.9 While Loops 10.10 Loop and a Half 12.1 Functions and Parameters 1 12.2 Functions and Parameters 2 12.3 Functions and Parameters 3 12.4 Functions and Return Values 1 12.5 Functions and Return Values 2 21.5 Mouse Events: Mouse Clicked
 Standard 1.8 Mouse Click Events
 Standard 1.9 For Loops 1.11 If/Else Statements 1.12 While Loops in Karel 1.13 Control Structures Example 2.1 Challenge Problems 4.2 Variables 4.4 Basic Math in JavaScript 6.1 Booleans 6.2 Logical Operators 6.3 Comparison Operators 6.5 For Loops in JavaScript 6.7 For Loop Practice 6.8 Random Numbers 6.9 While Loops 6.10 Loop and a Half 8.1 Functions and Parameters 1 8.2 Functions and Parameters 2 8.3 Functions and Parameters 3 8.4 Functions and Return Values 1 8.5 Functions and Return Values 2 10.5 Mouse Events: Mouse Clicked
 Standard 2.10 For Loops 2.12 If/Else Statements 2.13 While Loops in Karel 2.14 Control Structures Example 3.2 Challenge Problems 5.2 Variables 5.4 Basic Math in JavaScript 7.1 Booleans 7.2 Logical Operators 7.3 Comparison Operators 7.5 For Loops in JavaScript 7.7 For Loop Practice 7.9 While Loops 7.10 Loop and a Half 9.1 Functions and Parameters 1 9.2 Functions and Parameters 2 9.3 Functions and Parameters 3 9.4 Functions and Return Values 1 9.5 Functions and Return Values 2 9.10 Mouse Events: Mouse Clicked
 Standard 2.10 For Loops 2.12 If/Else Statements 2.13 While Loops in Karel 2.14 Control Structures Example 3.2 Challenge Problems 5.2 Variables 5.4 Basic Math in JavaScript 7.1 Booleans 7.2 Logical Operators 7.3 Comparison Operators 7.5 For Loops in JavaScript 7.7 For Loop Practice 7.8 Random Numbers 7.9 While Loops 7.10 Loop and a Half 9.1 Functions and Parameters 1 9.2 Functions and Parameters 2 9.3 Functions and Parameters 3 9.4 Functions and Return Values 1 9.5 Functions and Return Values 2 9.10 Mouse Events: Mouse Clicked
 Standard 2.10 For Loops 2.12 If/Else Statements 2.13 While Loops in Karel 2.14 Control Structures Example 3.2 Challenge Problems 5.2 Variables 5.4 Basic Math in JavaScript 7.1 Booleans 7.2 Logical Operators 7.3 Comparison Operators 7.5 For Loops in JavaScript 7.7 For Loop Practice 7.9 While Loops 7.10 Loop and a Half 9.1 Functions and Parameters 1 9.2 Functions and Parameters 2 9.3 Functions and Parameters 3 9.4 Functions and Return Values 1 9.5 Functions and Return Values 2 9.10 Mouse Events: Mouse Clicked
 Standard 8.2 Variables 8.4 Basic Math 8.5 Random Numbers 8.7 Booleans 8.9 Logical Operators 8.10 Comparison Operators 8.11 While Loops 8.12 For Loops
 Standard 2.10 For Loops 2.12 If/Else Statements 2.13 While Loops in Karel 2.14 Control Structures Example 3.2 Challenge Problems 5.2 Variables 5.4 Basic Math in JavaScript 7.1 Booleans 7.2 Logical Operators 7.3 Comparison Operators 7.5 For Loops in JavaScript 7.7 For Loop Practice 7.9 While Loops 7.10 Loop and a Half 9.1 Functions and Parameters 1 9.2 Functions and Parameters 2 9.3 Functions and Parameters 3 9.4 Functions and Return Values 1 9.5 Functions and Return Values 2 9.10 Mouse Events: Mouse Clicked
 Standard 2.2 Variables 2.4 Basic Math in JavaScript
 Standard 2.2 Variables 2.4 Basic Math in JavaScript
 Standard 2.10 For Loops 2.12 If/Else Statements 2.13 While Loops in Karel 2.14 Control Structures Example 3.2 Challenge Problems 5.2 Variables 5.4 Basic Math in JavaScript 7.1 Booleans 7.2 Logical Operators 7.3 Comparison Operators 7.5 For Loops in JavaScript 7.7 For Loop Practice 7.9 While Loops 7.10 Loop and a Half 9.1 Functions and Parameters 1 9.2 Functions and Parameters 2 9.3 Functions and Parameters 3 9.4 Functions and Return Values 1 9.5 Functions and Return Values 2 9.10 Mouse Events: Mouse Clicked
 Standard 2.10 For Loops 2.12 If/Else Statements 2.13 While Loops 2.15 Control Structures Example 3.2 Variables 3.4 Basic Math 3.6 Random Numbers 7.1 Booleans 7.3 Logical Operators 7.4 Comparison Operators 7.6 While Loops 7.7 The Break Statement 7.9 For Loops 13.4 Mouse Click Events
 Standard 2.9 For Loops 2.11 If/Else Statements 2.12 While Loops 2.14 Control Structures Example 4.2 Variables 4.4 Basic Math 4.6 Random Numbers 6.1 Booleans 6.3 Logical Operators 6.4 Comparison Operators 6.6 While Loops 6.7 The Break Statement 6.9 For Loops 8.4 Mouse Click Events 14.1 Challenge Problems
 Standard 2.10 For Loops 2.12 If/Else Statements 2.13 While Loops in Karel 2.14 Control Structures Example 3.2 Challenge Problems 5.2 Variables 5.4 Basic Math in JavaScript 7.1 Booleans 7.2 Logical Operators 7.3 Comparison Operators 7.5 For Loops in JavaScript 7.7 For Loop Practice 7.9 While Loops 7.10 Loop and a Half 9.1 Functions and Parameters 1 9.2 Functions and Parameters 2 9.3 Functions and Parameters 3 9.4 Functions and Return Values 1 9.5 Functions and Return Values 2 9.10 Mouse Events: Mouse Clicked
 Standard 3.10 For Loops 3.12 If/Else Statements 3.13 While Loops in Karel 3.14 Control Structures Example 4.2 Challenge Problems 6.2 Variables 6.4 Basic Math in JavaScript 12.10 Mouse Events: Mouse Clicked 24.5 Functions and Return Values 2 24.5 Functions and Return Values 2 24.4 Functions and Return Values 1 24.4 Functions and Return Values 1 24.3 Functions and Parameters 3 24.3 Functions and Parameters 3 24.2 Functions and Parameters 2 24.2 Functions and Parameters 2 24.1 Functions and Parameters 1 24.1 Functions and Parameters 1 10.10 Loop and a Half 10.9 While Loops 10.8 Random Numbers 10.7 For Loop Practice 10.5 For Loops in JavaScript 10.3 Comparison Operators 10.2 Logical Operators 10.1 Booleans
 Standard 1.9 For Loops 1.11 If/Else Statements 1.12 While Loops in Karel 1.13 Control Structures Example
 Standard 4.10 For Loops 4.12 If/Else Statements 4.13 While Loops in Karel 4.14 Control Structures Example 5.2 Variables 5.4 Basic Math in JavaScript 6.1 Booleans 6.2 Logical Operators 6.3 Comparison Operators 6.5 For Loops in JavaScript 6.7 For Loop Practice 6.9 While Loops 6.10 Loop and a Half 7.1 Functions and Parameters 1 7.2 Functions and Parameters 2 7.3 Functions and Parameters 3 7.4 Functions and Return Values 1 7.5 Functions and Return Values 2 7.10 Mouse Events: Mouse Clicked
 Standard 2.9 For Loops 2.11 If/Else Statements 2.12 While Loops 2.15 Control Structures Example 3.1 Challenge Problems 5.2 Variables 5.4 Basic Math 5.6 Random Numbers 8.3 Logical Operators 8.4 Comparison Operators 8.6 While Loops 8.7 The Break Statement 8.9 For Loops 11.4 Mouse Click Events
 Standard 2.9 For Loops 2.11 If/Else Statements 2.12 While Loops in Karel 2.13 Control Structures Example 3.2 Challenge Problems 5.2 Variables 5.4 Basic Math in JavaScript 7.1 Booleans 7.2 Logical Operators 7.3 Comparison Operators 7.5 For Loops in JavaScript 7.7 For Loop Practice 7.8 Random Numbers 7.9 While Loops 7.10 Loop and a Half 9.1 Functions and Parameters 1 9.2 Functions and Parameters 2 9.3 Functions and Parameters 3 9.4 Functions and Return Values 1 9.5 Functions and Return Values 2 9.10 Mouse Events: Mouse Clicked
 Standard 2.10 For Loops 2.12 If/Else Statements 2.13 While Loops in Karel 2.14 Control Structures Example 3.2 Challenge Problems 5.2 Variables 5.4 Basic Math in JavaScript 7.1 Booleans 7.2 Logical Operators 7.3 Comparison Operators 7.5 For Loops in JavaScript 7.7 For Loop Practice 7.9 While Loops 7.10 Loop and a Half 9.1 Functions and Parameters 1 9.2 Functions and Parameters 2 9.3 Functions and Parameters 3 9.4 Functions and Return Values 1 9.5 Functions and Return Values 2 9.10 Mouse Events: Mouse Clicked
 Standard 13.2 Variables 13.4 Basic Math in JavaScript 13.5 Booleans 13.6 Logical Operators 13.7 Comparison Operators 13.9 For Loops in JavaScript 13.10 For Loop Practice 13.11 Random Numbers 13.12 While Loops 13.13 Loop and a Half 13.14 Functions and Parameters 1 13.15 Functions and Parameters 2 13.16 Functions and Return Values 1 13.17 Functions and Return Values 2
 Standard 4.3 Booleans
 Standard 8.2 Variables 8.4 Basic Math in JavaScript 8.5 Booleans 8.6 Logical Operators 8.7 Comparison Operators 8.9 For Loops in JavaScript 8.10 For Loop Practice 8.11 Random Numbers 8.12 While Loops 8.13 Loop and a Half 8.14 Functions and Parameters 1 8.15 Functions and Parameters 2 8.16 Functions and Return Values 1 8.17 Functions and Return Values 2
 Standard 12.2 Variables 12.4 Basic Math in JavaScript 12.5 Booleans 12.6 Logical Operators 12.7 Comparison Operators 12.9 For Loops in JavaScript 12.10 For Loop Practice 12.11 Random Numbers 12.12 While Loops 12.13 Loop and a Half 12.14 Functions and Parameters 1 12.15 Functions and Parameters 2 12.16 Functions and Return Values 1 12.17 Functions and Return Values 2
 Standard 1.10 For Loops 1.12 If/Else Statements 1.13 While Loops in Karel 1.14 Control Structures Example 2.2 Challenge Problems 5.2 Variables 5.4 Basic Math in JavaScript 7.1 Booleans 7.2 Logical Operators 7.3 Comparison Operators 7.5 For Loops in JavaScript 7.7 For Loop Practice 7.9 While Loops 7.10 Loop and a Half 9.1 Functions and Parameters 1 9.2 Functions and Parameters 2 9.3 Functions and Parameters 3 9.4 Functions and Return Values 1 9.5 Functions and Return Values 2 11.5 Mouse Events: Mouse Clicked