Please enable JavaScript to use CodeHS

AP Computer Science Principles in Roblox

Description

In this lesson, students learn about if and if/else statements as a way to make decisions and execute specific code depending on the validity of a condition. They will also learn about and use Boolean values. Booleans refer to a value that is either true or false and are used to test whether a specific condition is true or false.

Objective

Students will be able to:

  • Create Boolean variables to represent meaningful yes/no values
  • Print out the value of a Boolean variable
  • Explain the purpose of if and if/else statements
  • Create their own if/else statements to selectively choose which code is executed in their programs
Description

In this lesson, students will learn about comparison and logical operators. Comparison operators let students compare two values. Logical operators allow students to connect or modify Boolean expressions. Three logical operators are not, and, and or.

Objective

Students will be able to:

  • Explain the meaning of each of the comparison operators (<, <=, >, >=, ==, ~=)
  • Describe the meaning and usage of each logical operator: not, and, and or
  • Construct logical statements using boolean variables and logical operators
  • Create programs using the comparison operators to compare values
  • Predict the boolean result of comparing two values
  • Print out the boolean result of comparing values
Description

In this lesson, students learn about the importance of planning when writing complex programs. Students learn that flowcharts and pseudocode are essential tools that help break down a problem.

Objective

Students will be able to:

  • Explain the role of pseudocode and flow charts in writing complex programs
  • Explain how adding comments make a program clearer and more readable
Description

In this lesson, students take what they have learned about using operators and apply that to Roblox Studio programs.

Objective

Students will be able to:

  • Use logical and comparison operators in a Roblox program
Description

In this lesson, students will learn how randomization can enhance a program.

Objective

Students will be able to:

  • Explain why random numbers are a useful part of computer programs
  • Create and use random values in a program
Description

In this lesson, students will explore while loops and variables. This combines the ideas of creating variables, updating variables throughout a loop, and determining the correct ending condition.

Objective

Students will be able to:

  • Explain the purpose of a while loop
  • Create while loops to repeat code while a condition is true
  • Utilize while loops to solve new types of problems
Description

In this lesson, students will learn about for loops. For loops are used to repeat code a fixed number of times. Students will learn how to create and use for loops and how to decide whether a for loop or a while loop is required for the situation.

Objective

Students will be able to:

  • Create for loops in Lua
  • Explain the purpose of for loops
  • Utilize for loops to avoid typing out repeated code
Description

In this lesson, students will learn how to “clean up” their Roblox programs by preventing a player from activating an event too often. Students will learn how to use a break statement to end a loop and a debouncing technique to prevent a function from running too many times.

Objective

Students will know how to:

  • Use a break statement to end a loop
  • Use a debouncing technique to prevent a function from running more times then intended
Description

In this lesson, students are reintroduced to algorithms. Algorithms are step-by-step instructions that solve a problem. Programs implement algorithms. All algorithms are built using sequencing, selection, and iteration. This lesson is designed to test students’ knowledge of control structures and algorithm design in preparation for upcoming concepts.

Objective

Students will be able to:

  • Analyze an algorithm and explain why it works
  • Use control structures to create general algorithms
Description

In this lesson, students review content with a multiple-choice unit quiz.

Objective

Students will be able to:

  • Prove their knowledge of basic coding concepts through a multiple-choice quiz