### Please enable JavaScript to use CodeHS

Introduction to Computer Science in JavaScript (Golden)

#### Points

Activity Points
Programming with Karel
1.1 Introduction to Programming With Karel
1.1.1 Introduction to Programming With Karel 1
1.1.2 Quiz: Karel Commands 5
1.1.3 Our First Karel Program 1
1.1.4 Your First Karel Program 5
1.1.5 Short Stack 5
1.2 More Basic Karel
1.2.1 More Basic Karel 1
1.2.2 More Basic Karel Quiz 5
1.2.3 Tennis Ball Square 1
1.2.4 Make a Tower 5
1.2.5 Pyramid of Karel 5
1.3 Karel Can't Turn Right
1.3.1 Karel Can't Turn Right 1
1.3.2 Karel Can't Turn Right Quiz 5
1.3.3 Tower and Turn Right 1
1.3.4 Slide Karel 5
1.3.5 Fireman Karel 5
1.3.6 Karel Turns Right Badge 1
1.4 Functions in Karel
1.4.1 Functions in Karel 1
1.4.2 Functions in Karel Quiz 5
1.4.3 Turn Around 1
1.4.4 Pancakes 5
1.4.5 Mario Karel 5
1.5 The Start Function
1.5.1 The Start Function 1
1.5.2 The Start Function Quiz 5
1.5.3 Tower with Start Function 1
1.5.4 Pancakes with Start 5
1.6 Top Down Design and Decomposition in Karel
1.6.1 Top Down Design and Decomposition in Karel 1
1.6.2 Top Down Design and Decomposition Quiz 5
1.6.3 Hurdle Karel 1
1.6.4 The Two Towers 5
1.7.2 Commenting Your Code Quiz 5
1.7.3 Hurdle Karel 1
1.7.4 The Two Towers + Comments 5
1.8 Super Karel
1.8.1 Super Karel 1
1.8.2 Super Karel Quiz 5
1.8.3 Hurdle Karel (with SuperKarel) 1
1.8.4 The Two Towers + SuperKarel 5
1.9 For Loops
1.9.1 For Loops 1
1.9.2 For Loops Quiz 5
1.9.3 Repeated Move 1
1.9.4 Put Down Tennis Balls 1
1.9.5 Take 'em All 5
1.9.6 Dizzy Karel 5
1.9.7 Ball in Each Corner 5
1.9.8 Lots of Hurdles 5
1.10 If Statements
1.10.1 If Statements 1
1.10.2 If Statements Quiz 5
1.10.3 If Statements 1
1.10.4 Safe Take Ball 1
1.10.5 Is There a Ball? 5
1.10.6 Don't Crash! 5
1.11 If/Else Statements
1.11.1 If/Else Statements 1
1.11.2 If/Else Statements Quiz 5
1.11.3 If/Else Statements 1
1.11.4 Opposite Day 1
1.11.5 Right Side Up 5
1.11.6 Right vs. Left Square 5
1.12 While Loops in Karel
1.12.1 While Loops in Karel 1
1.12.2 While Loops in Karel Quiz 5
1.12.3 Move to Wall 1
1.12.5 Lay Row of Tennis Balls 5
1.12.6 Big Tower 5
1.13 Control Structures Example
1.13.1 Control Structures Example 1
1.13.2 Control Structures Example Quiz 5
1.13.3 Cleanup Karel 1
1.13.4 Random Hurdles 5
1.13.5 Mindset Survey 1 1
1.14 More Karel Examples and Testing
1.14.1 More Karel Examples and Testing 1
1.14.2 Quiz: Which Control Structure? 5
1.14.3 Move Tennis Ball Stack 1
1.14.4 Climbing Karel 1
1.15 How to Indent Your Code
1.15.1 How to Indent Your Code 1
1.15.2 How to Indent Your Code Quiz 5
1.15.3 Dance and Clean Karel 1
1.15.4 Diagonal 5
1.15.5 Staircase 5
1.16 Programming with Karel Quiz
1.16.1 Programming with Karel Quiz 5
Karel Challenges
2.1 Challenge Problems
2.1.1 Fetch 10
2.1.2 Racing Karel 10
2.1.3 Tower Builder 10
2.1.4 Super Cleanup Karel 10
2.1.5 Double Tennis Balls 10
JavaScript and Graphics
3.1 Hello World
3.1.1 Hello World 1
3.1.2 Hello World Quiz 5
3.1.3 Hello World 1
3.1.4 Your Name and Hobby 5
3.2 Variables
3.2.1 Variables 1
3.2.2 Variables Quiz 5
3.2.3 Basic Variables 1
3.2.4 Daily Activities 5
3.3 User Input
3.3.1 User Input 1
3.3.2 User Input Quiz 5
3.3.3 Basic User Input 1
3.3.4 Dinner Plans 5
3.4 Basic Math in JavaScript
3.4.1 Basic Math in JavaScript 1
3.4.2 Basic Math in JavaScript Quiz 5
3.4.3 Simple Calculator 1
3.4.4 Dollars to Pounds 1
3.4.5 Dividing Up Groups 1
3.4.6 T-Shirt Shop 5
3.4.7 Running Speed 5
3.5 Using Graphics in JavaScript
3.5.1 Graphics 1
3.5.2 JavaScript Graphics Quiz 5
3.5.3 Graphics Hello World 1
3.5.4 Blue Circle 1
3.5.5 Red Rectangle 1
3.5.6 8 Ball 1
3.5.7 Flag of the Netherlands 5
3.5.8 Snowman 5
3.6 Programming with JavaScript Quiz
3.6.1 JavaScript and Graphics Quiz 25
Graphics Challenges
4.1 Collaborative Programming
4.1.1 Pair-Programming 1
4.1.2 Pair-Programming 5
4.1.3 Why Practice Pair-Programming? 1
4.1.4 Pair-Programming Reflection 5
4.2 Graphics Challenges
4.2.1 Ghost 10
4.2.2 Fried Egg 10
4.2.3 Draw Something 10
JavaScript Control Structures
5.1 Booleans
5.1.1 Booleans 1
5.1.2 Booleans Quiz 5
5.1.3 First Boolean 1
5.1.4 Do You Have a Dog? 5
5.2 Logical Operators
5.2.1 Logical Operators 1
5.2.2 Logical Operators Quiz 5
5.2.3 Light Switch 1
5.2.4 President 1
5.2.5 Wasting Time 1
5.2.7 School's Out 5
5.3 Comparison Operators
5.3.1 Comparison Operators 1
5.3.2 Comparison Operators Quiz 5
5.3.3 Voting Age 1
5.3.5 Rolling Dice 5
5.3.6 Girl Scout Designation 5
5.4 If Statements
5.4.1 If Statements 1
5.4.2 If Statements Quiz 5
5.4.3 Negative Numbers 1
5.4.4 Great Names 1
5.4.5 Even and Odd 1
5.4.7 Teenagers 5
5.4.8 Dietary Restrictions 5
5.4.10 Mindset Survey 2 1
5.5 For Loops in JavaScript
5.5.1 Basic For Loop 1
5.5.2 For Loops Quiz 5
5.5.3 For Loop 1
5.5.4 Chalkboard 5
5.5.5 The Worm 5
5.5.6 Caterpillar 5
5.6 General For Loops
5.6.1 General For Loop 1
5.6.2 General For Loop Quiz 5
5.6.3 Countdown 1
5.6.4 Count By Twos 1
5.6.5 Count By Sevens 5
5.6.6 Powers of Two 5
5.7 For Loop Practice
5.7.1 For Loop Examples 1
5.7.2 For Loop Examples Quiz 5
5.7.3 For Loop Sum 1
5.7.4 Better Sum 5
5.7.5 Factorial 5
5.7.6 All Dice Values 5
5.8 Random Numbers
5.8.1 Random Numbers 1
5.8.2 Random Numbers Quiz 5
5.8.3 Rolling a Die 1
5.8.4 Flipping a Coin 1
5.8.5 Lots of Rolls 5
5.8.6 Random Color Square 5
5.9 While Loops
5.9.1 While Loops 1
5.9.2 While Loops Quiz 5
5.9.3 While Loop Countdown 1
5.9.4 Inventory 5
5.9.5 Fibonacci 5
5.9.6 Concentric Circles 5
5.10 Loop and a Half
5.10.1 Loop and a Half 1
5.10.2 Loop and a Half Quiz 5
5.10.4 Snake Eyes 5
5.11 Javascript Control Structures Quiz
5.11.1 JavaScript Control Structures Quiz 25
Control Structures Challenges
6.1 Control Structures Challenges
6.1.1 Guessing Game 10
6.1.2 Circles in Circles 10
6.1.3 Circles in Squares 10
6.1.4 Happy Birthday! 10
Functions and Parameters
7.1 Functions and Parameters 1
7.1.1 Functions and Parameters 1 1
7.1.2 Functions and Parameters Quiz 1 5
7.1.3 Double Number 1
7.1.4 Square 5
7.1.5 Triple 5
7.2 Functions and Parameters 2
7.2.1 Functions and Parameters 2 1
7.2.2 Functions and Parameters Quiz 2 5
7.2.3 Sum Function 1
7.2.4 Area of Triangle 5
7.2.5 Height in Meters 5
7.3 Functions and Parameters 3
7.3.1 Functions and Parameters 3 1
7.3.2 Functions and Parameters Quiz 3 5
7.3.3 Draw Circles 1
7.3.4 Vertical Lines 5
7.3.5 Graphics Stop Light 5
7.3.6 Pool Table 5
7.3.7 Cityscape 5
7.3.9 Mindset Survey 3 1
7.4 Functions and Return Values 1
7.4.1 Functions and Return Values 1 1
7.4.2 Functions and Return Values Quiz 5
7.4.3 Double Number 1
7.4.4 Square with Return Values 5
7.4.5 Triple with Return Values 5
7.4.6 Gymnastics Mats 5
7.5 Functions and Return Values 2
7.5.1 Functions and Return Values 2 1
7.5.2 Functions and Return Values Quiz 2 5
7.5.3 Return Values 1
7.5.4 Is It Even? 5
7.5.5 Max 5
7.6 Local Variables and Scope
7.6.1 Local Variables and Scope 1
7.6.2 Local Variables and Scope Quiz 5
7.6.3 Return Values 1
7.6.4 Local Variables 5
7.7 Functions and Parameters Quiz
7.7.1 Functions and Parameters Quiz 5
Functions Challenges
8.1 Functions Challenges
8.1.1 Hailstone Sequence 10
8.1.2 Balloons 10
8.1.4 Ghost Invasion! 10
Animation and Games
9.1 Timers
9.1.1 Timers 1
9.1.2 Timers Quiz 5
9.1.3 Moving Ball 1
9.1.4 Magic 8 Ball 1
9.1.5 Crazy Ball 5
9.2 Random Circles
9.2.1 Example: Random Circles 1
9.2.2 Random Circles Quiz 5
9.2.3 Random Circles 1
9.2.4 Spinner Example 1
9.2.5 Growing Circle 5
9.2.6 Paint splatter 5
9.3 Random Ghosts
9.3.1 Example: Random Ghosts 1
9.3.2 Random Ghosts Quiz 5
9.3.3 Random Ghosts 1
9.3.4 Random Fireworks 1
9.3.5 Circle Wall 5
9.3.6 Brick Wall 5
9.4 Bouncing Ball
9.4.1 Example: Bouncing Ball 1
9.4.2 Bouncing Ball Quiz 5
9.4.3 Bouncing Ball 1
9.4.4 Hotspot Ball 5
9.4.5 Trail 5
9.5 Mouse Events: Mouse Clicked
9.5.1 Mouse Events: Mouse Clicked 1
9.5.2 Mouse Events: Mouse Clicked Quiz 5
9.5.3 Click For Circles 1
9.5.4 Click For Ghosts 1
9.5.5 Teleporting Ball 5
9.5.6 Pause 5
9.6 Mouse Events: Mouse Moved
9.6.1 Mouse Events: Mouse Moved 1
9.6.2 Mouse Events: Mouse Moved Quiz 5
9.6.3 Simple Painting 1
9.6.4 Colorful Drag to Paint 1
9.6.5 Coordinates 5
9.6.6 Target 5
9.7 Drawing Lines
9.7.1 Example: Drawing Lines 1
9.7.2 Drawing Lines Quiz 5
9.7.3 Drawing Lines 1
9.7.4 Leash 5
9.7.6 Mindset Survey 4 1
9.8 Key Events
9.8.1 Key Events 1
9.8.2 Key Events Quiz 5
9.8.3 Keyboard Square 1
9.8.4 Basic Snake 5
9.9 Crazy Ball Game
9.9.1 Crazy Ball Game 1 1
9.9.2 Crazy Ball Game Quiz 1 5
9.9.3 Crazy Ball Game 1 1
9.9.4 Crazy Ball Game 2 1
9.9.5 Crazy Ball Game Quiz 2 5
9.9.6 Crazy Ball Game 2 1
9.9.7 Click for Collision 5
9.9.8 Drag and Drop 5
9.10 Animation and Games Quiz
9.10.1 Animation and Games Quiz 5
Animation Challenges
10.1 Animation Challenges
10.1.2 Increasing Number of Shapes 10
Project: Breakout
11.1 Breakout
11.1.1 Bricks 10
11.1.3 Breakout 10
Final Project
12.1 Project Prep and Development
12.1.1 Planning and Design 5
12.1.2 Pseudocode 5
12.1.3 Write the Code! 10
Final Exam
13.1 Final Exam
13.1.1 JavaScript Final Exam Pt. 1: Multiple Choice 0
Midterm
14.1 Midterm
14.1.1 Midterm Pt 1: Multiple Choice 0
Extra Karel Practice
15.1 Extra Karel Practice
15.1.1 Functions Practice: K For Karel 10
15.1.2 Functions Practice: Karel Plants A Tree 10
15.1.3 Functions Practice: X Marks the Spot 10
15.1.4 While Loop Practice: Blackout 10
15.1.5 While Loop Practice: Move To Top 10
15.1.6 Functions and While Loop Practice: Opposite Corner 10
15.1.7 While Loop Practice: Checkered Row 10
15.1.8 For Loop Practice: Tall Hurdles 10
15.1.9 Functions and While Loop Practice: Row and Back 10
15.1.10 Functions and For Loop Practice: Opposite Squares 10
15.1.11 Stairway To Heaven 10
15.1.13 For Loop Square 5
Extra Karel Puzzles
16.1 Extra Karel Puzzles
16.1.1 Midpoint Karel 10
16.1.2 Target Karel 10
16.1.3 The Winding Yellow Road 10
16.1.4 Super Random Hurdles 10
16.1.5 Copy 10
16.1.6 Multiply 10
16.1.7 Fibonacci Karel 10
16.1.8 Comparison Karel 10
16.1.9 Swap 10
16.1.10 Sorting Karel 10
Functions and Parameters Practice
17.1 Functions and Parameters Practice
17.1.1 Taking a Power 10
17.1.2 Dot Rectangle 10
17.1.3 Print the Date 10
17.1.4 Concentric Circles 10
17.1.5 Graphics Staircase 10
17.1.6 The Weekend 5
17.1.7 Functions and Parameters Badge 0
Extra Console Challenges
18.1 Prime Numbers
18.1.1 Prime Numbers 10
18.1.2 Find the Max 10
18.1.3 Prime Factorization 10
18.1.4 Fizz Buzz 10
18.1.5 Grid Printer 10
18.1.6 Number Sum 10
18.1.7 Hailstone Sequence 10
18.1.8 Pythagorean Triples 10
18.1.9 Digit Array 10
More Graphics and Animation
19.1 Fun Snake
19.1.1 Fun Snake 1 10
19.1.2 Fun Snake 2 10
19.1.3 Fun Snake 3 10
19.1.4 Fun Snake 4 - A Full Game! 10
19.2 Fun Graphics Challenges
19.2.1 Balloons 10
19.2.2 Broccoli 10
19.2.4 Snowman Loop 10
Data Structures Challenge Problems
20.1 Conway's Game of Life
20.1.1 Make The Grid 5
20.1.2 Find Life 5
20.1.3 Finish Up 5
20.2 Connect Four
20.2.1 Make The Board 5
20.2.2 Take Turns 5
20.2.3 Find the Winner 5
Evolution Simulation
21.1 Evolution Simulation
21.1.1 Evolution Simulation: Part 1 10
21.1.2 Evolution Simulation: Part 2 10
21.1.3 Evolution Simulation: Part 3 10
21.1.4 Evolution Simulation: Part 4 10
21.1.5 Evolution Simulation: Part 5 10
Demo Problems
22.1 Lesson 1
22.1.1 Square Method 0
22.1.2 Java Sum 0
22.1.3 Python Sum 0
22.1.4 JavaScript Sum 0
Extra Quiz Questions
23.1 Basic Javascript and Graphics
23.1.1 Extra JavaScript Graphics Quesions 0
23.1.2 Extra Logical Operators Questions 0
23.1.3 Extra Functions and Return Values Questions 0
23.1.4 Extra Local Variables and Scope Questions 0
23.2 Animation and Games
23.2.1 Extra Timers Questions 0
23.2.2 Extra Bouncing Ball Questions 0
23.2.3 Extra Mouse Events: Mouse Clicked Questions 0
23.2.4 Extra Key Events Questions 0
23.2.5 Extra Crazy Ball Game Questions 0
23.3 Basic Data Structures
23.3.1 Extra Intro to Lists/Arrays Questions 0
23.3.2 Extra Indexing into an Array Questions 0
23.3.3 Extra Adding/Removing from an Array Questions 0
23.3.4 Extra Array Length and Looping Through Arrays Questions 0
23.3.5 Extra Iterating Over an Array Questions 0
23.3.6 Extra Finding an Element in a List Questions 0
23.3.7 Extra Removing an Element from an Array Questions 0
23.3.8 Extra Basics of Objects Questions 0
23.3.9 Extra Intro to Sets Questions 0
23.3.10 Extra Intro to Grids Questions 0
Visualizing Music
24.1 Visualizing Music
24.1.1 Visualizing Music 1
24.1.2 Our First Visualization 1
24.1.3 Vertical Bars 1
24.1.4 Vertical Bars with Color 1
24.1.5 Changing Circles 1
24.1.7 Changing Colors 5
24.1.8 Custom Colors 5
24.1.9 Create Your Own Music Visualization 5
Data Structures
25.1 Intro to Lists/Arrays
25.1.1 Intro to Lists/Arrays 1
25.1.2 Intro to Lists/Arrays Quiz 5
25.1.3 Making an Array 1
25.1.4 List of Places to Travel 5
25.1.5 List of Even Numbers 5
25.2 Indexing Into an Array
25.2.1 Indexing Into an Array 1
25.2.2 Indexing into an Array Quiz 5
25.2.3 Array Indexing Practice 1
25.2.4 Top Websites 5
25.3.1 Adding/Removing From an Array 1
25.3.2 Adding/Removing from an Array Quiz 5
25.3.4 Practice Push and Pop 5
25.4 Array Length and Looping Through Arrays
25.4.1 Array Length and Looping Through Arrays 1
25.4.2 Array Length and Looping Through Arrays Quiz 5
25.4.3 Print Shopping List 1
25.4.4 Sum Array 1
25.4.5 Product of List 5
25.4.6 Print Flight Itinerary 5
25.4.7 Double List 5
25.4.8 Evens Only List 5
25.4.9 Reverse List 5
25.5 Iterating Over an Array
25.5.1 Examples: Iterating Over an Array 1
25.5.2 Iterating Over an Array Quiz 5
25.5.3 Coin Flips 1
25.5.4 Many Crazy Balls 1
25.5.5 Coin Flip Fun: Number of Heads and Tails 5
25.5.6 Coin Flip Fun: Longest Streak of Heads 5
25.5.7 Changing Circles 5
25.5.8 Draw a Barcode 5
25.6 Finding an Element in a List
25.6.1 Finding an Element in a List 1
25.6.2 Finding an Element in a List Quiz 5
25.6.3 Array indexOf 1
25.6.4 Who is in Line? 5
25.7 Removing an Element From an Array
25.7.1 Removing an Element From an Array 1
25.7.2 Removing an Element from an Array Quiz 5
25.7.3 Splice and Remove 1
25.7.4 Remove From Line 5
25.8 Intro to Objects/Maps
25.8.1 Intro to Objects/Maps 1
25.8.2 Intro to Objects / Maps Quiz 5
25.8.3 Phonebook 1
25.8.4 Sidekicks 5
25.9 Basics of Objects
25.9.1 Basics of Objects 1
25.9.2 Basics of Objects Quiz 5
25.9.3 Object Literal Phonebook 1
25.9.4 Object Property Phonebook 1
25.9.5 Beware Dot Notation! 1
25.10 Iterating Over an Object
25.10.1 Iterating Over An Object 1
25.10.2 Iterating over an Object Quiz 5
25.10.3 Print Phonebook 1
25.10.4 Hogwarts 5
25.11 When Do I Use an Object?
25.11.1 When Do I Use An Object? 1
25.11.2 When do I use an Object Quiz 5
25.11.4 Does the Key Exist? 1
25.11.5 Text Messages 5
25.12 Intro to Sets
25.12.1 Intro to Sets 1
25.12.2 Intro to Sets Quiz 5
25.12.3 Basic Sets 1
25.12.4 Vowels 5
25.12.5 Mutual Friends 5
25.12.6 Total Network of Friends 5
25.13 Intro to Grids
25.13.1 Intro to Grids 1
25.13.2 Intro to Grids Quiz 5
25.13.3 Grid Basics 1
25.13.4 Building a Database 5
25.14 Looping Over a Grid
25.14.1 Looping Over a Grid 1
25.14.2 Looping Over a Grid Quiz 5
25.14.3 Print Grid 1
25.14.4 Summing Grid 5
25.15 Grid Example: Get a Row
25.15.1 Grid Example: Get a Row 1
25.15.2 Grid Example: Get a Row Quiz 5
25.15.3 Get a Row 1
25.15.4 Grid Diagonal 5
25.15.5 Data Structures Exercises Badge 0
25.16 Data Structures Challenges
25.16.1 Watercolor Grid 10
25.16.2 Data Structures Unit Quiz 5
25.16.3 Data Structures Challenges Badge 0
Project: Tic Tac Toe
26.1 Tic Tac Toe
26.1.1 Tic Tac Toe: Part 1 10
26.1.2 Tic Tac Toe: Part 2 10
26.1.3 Tic Tac Toe: Full Game 10
26.1.4 Tic Tac Toe Badge 0
Project: Helicopter Game
27.1 Game Design: Helicopter
27.1.1 Introduction to Helicopter 1
27.2 Basics
27.2.1 Moving the Helicopter 1
27.2.2 Moving the Helicopter 5
27.2.5 Smoother Movement 1
27.2.6 Smoother Movement 5
27.3 Improvements
27.3.1 Colliding with Walls 1
27.3.2 Wall Collisions 5
27.3.3 Colliding with Obstacles 1
27.3.4 Obstacle Collisions 5
27.3.7 Moving the Terrain 1
27.3.8 Moving the Terrain 5
27.4 Polish
27.4.1 Helicopter Image and Points! 1
27.4.2 Image and Points 5
27.4.3 Dust 1
27.4.4 Dust 5
27.4.5 More Obstacles 1
27.4.6 More Obstacles 5
27.4.7 Helicopter Extensions 10