u/DapperBumblebee22

How to push values onto an array using random() and for() loop.

I will explain now in more detail. I am currently using the Khan Academy Javascript course to learn the basics of Javascript. I have been struggling with this specific project so much, so don't mind the exstensive comments.

//Controls the X and Y Positions of the raindrops.

var xPositions = [200];

var yPositions = [0];

//This for loop uses a random function to add more values to the X and Y positions. This will create more raindrops.

//Draw Function to animate.

draw = function() {

background(204, 247, 255);

//This for loop draws the raindrops based on the X and Y arrays above.

for (var i = 0; i < xPositions.length; i++) {

//Color + Decorations of the raindrops.

noStroke();

fill(0, 200, 255);

//Draws a circle at the X position and Y Position based on the cyclic increases of the variable i. Y position will then drop by a rate of 5 to make the rain fall to the ground.

ellipse(xPositions[i], yPositions[i]%400, 10, 10);

yPositions[i] += 5;

}

};

As you can see, there is a comment that describes the for loop using a random function to push values to the xPositions and yPositions arrays, which in turn will allow me to create more raindrops. My question is how can I do this? I've been experimenting typing different things, but it seems that the for loop just keeps crashing my computer. I know this is a very simple question but I am still on the basics.

reddit.com
u/DapperBumblebee22 — 14 days ago

Screen Time Is Wrong

My IPhone 15 Plus has parental controls (the kind built into apple IPhones not an external app). Though it is consistently inaccurate and it is starting to get frustrating. I've talked to my parents about this but they don't really care nor know what to do.

I have 5 hours total for safari and 5 hours and 59 minutes for everything else. It times everything out at 9 PM and opens again at 5 AM the next day. However, sometimes it just does not work.

For example, today it screen timed out everything despite the settings app saying that I am only at 3 ~~ ish hours. This also usually happens whenever I use my phone around 3-4 PM for some reason (if that matters).

Or, sometimes, I will wake up in the morning (having not used it at all), and it will say I used it for 7 or even 10 hours! Even though there's no way that is physically possible at the time. (For example, it is 8 AM, so I could not have used it for 10 hours).

I have updated my phone versions to the latest iOS (26.6). Shutting down and restarting the phone does not fix this issue. Is there any possible reason or solution to this?

reddit.com
u/DapperBumblebee22 — 2 months ago
▲ 0 r/mac

How to attach a magic mouse to an Imac

For some reason, despite the fact that I've tried multiple times doing exactly as its said in the manual, plugging the mouse into the computer, turning the mouse on, and waiting, then taking the plug out, I have been unable to connect the magic mouse to my Imac. Has anyone else had this problem or know a possible solution?

reddit.com
u/DapperBumblebee22 — 3 months ago