** sorry for the weird title
I'm taking a coding class and we have a variety of different assignments.
Recently we've been told to use code academy, and the ones I've recently done were learning Loops and functions.
For this one particular assignment I'm tasked with finishing a incomplete web page function
as seen below.
<meta charset='utf-8' >
<h2>Online Dot Racer</h2>
Two dots race to the finish!
<br<br>Enter the race length.
<br<br>Each time the user clicks the button, each dot advances a random amount (1, 2, or 3 steps).
<br<br>When a dot crosses the finish line, display the winner.
Race Length: <input type="text" id="lengthBox" size="12">
Red Dot: <span id="redSpan">0</span>
<p style="color: blue;">
Blue Dot: <span id="blueSpan">0</span>
<input type="button" value="Take a Step" onclick="takeAStep();">
now I'm not asking someone to completely solve this for me, I just want direction on what/how to get started.
I know i'm supposed to address the part that I highlighted in orange.
I'm supposed to make it so that whatever value the user puts in the "total distance" every time they press (take a step) red and blue take different steps untill they reach the finish, where a pop up/alert will announce the winner.
Two dots race to the finish! Enter the race length. Each time the user clicks the button, each dot advances a random amount (1, 2, or 3 steps). When a dot crosses the finish line, display the winner.
so yeah i'm lost on what I should do.
I have difficulties combining concepts together, you could say. I know I should be using the Looping function with some mathRdm thrown in there?
I just ask for direction, if someone could simply or "dumb it down" For me by feeding me step by step instructions. I'm not asking for specific copy and paste instructions, more like "you should adress this issue, before doing this, and etc"
or if you think there's some good resources for me or if I should do a particular exercise on code academy which would help...
any input at all is most appreciated, thanks