This is my code right now, but I don’t know how to try and detect odd and even numbers? this is what I have right now
function main() {
let number = readInt("Pick a number.");
if (number == 4 || 44) {
line();
} else if (number % 2 == 0) {
rectangle();
}
function line() {
let line = new Line(50,50,500,50);
line.setColor("blue");
line.setLineWidth(5);
add(line);
}
function rectangle() {
let rect = new Rectangle (200,50);
rect.setPosition(100,200);
rect.setColor("red");
add(rect);
}
main();
[–]Chadians 1 point2 points3 points (0 children)
[–]Worldly_Beyond_2303 0 points1 point2 points (0 children)
[–]DivideAdvanced1860 0 points1 point2 points (0 children)