2024-11-11
This chapter explains the card feature and how to use the test feature implemented on this site. It specifically explains how to write submission code when solving test problems.
Card Feature
Some articles have cards to check your understanding. These are multiple-choice questions with explanations available after selection. Shuffle the cards and repeat the questions to deepen your understanding.
Articles with cards have a card icon at the bottom right. Try solving the cards in this article.

How to Use the Test Feature
The test feature allows you to solve problems related to the article content, similar to the card feature. Tests consist of multiple questions, and you can check your score after solving all the questions. Some articles may not have test questions.

There are mainly three types of test questions:
- Drawing problems
- Output problems
- Others
Drawing Problems
In drawing problems, you use p5.js functions to draw specified shapes. The problem statement specifies what shapes to draw, so write your code accordingly.
Use the createCanvas() function to create a canvas and draw shapes within the setup() function. Functions like rect(), circle(), and line() are used to draw shapes. You may also use functions to set colors and line thickness.
function setup() {
createCanvas(400, 400);
// Code to draw shapes
}Output Problems
In output problems, you are required to output specified values to the standard output. The problem statement specifies what values to output, so write your code accordingly.
Use the print() function to output values to the standard output. You can also use the console.log() function for the same purpose.
function setup() {
print(1 + 1);
}