Posts

Showing posts from January, 2025

Lesson 3 Algorithm week 10

  Lesson 3 Algorithm week 10 Instructions:   Choose your editor : You may use p5js 1- the full lesson is here : Algorithm 2- In another tab, open: p5.js

Lesson 3 Code to Animate week 8

Lesson 3 Code to Animate week 8 Instructions:   Choose your editor : You may use p5js 1- the full lesson is here : code to animate 2- In another tab, open: tnis-ict8.blogspot.com 3- Copy the code provided and paste it into the : https://editor.p5js.org/  // Define variables for the airplane's position let x_plane, y_plane; // Define variables for clouds' positions let cloud1_x, cloud1_y, cloud2_x, cloud2_y; function setup() {     // Create a canvas and set background color     createCanvas(800, 400);     background(100, 200, 250); // Light blue sky     // Initialize airplane position at the center of the canvas     x_plane = width / 2;     y_plane = height / 2;     // Initialize clouds' positions     cloud1_x = random(width);     cloud1_y = 0; // Start at the top     cloud2_x = random(width);     cloud2_y = height / 2; } function draw() {     // Clear the can...