Beginner
Write a linear scale
Write scale(v) so that 0 rides gives y = 160 and 4,000 rides gives y = 0 (the y axis is flipped). 2,000 should give 80.
Use y = m·x + b. The page logs three test values.
What Check tests
- scale(0) is 160
- scale(4000) is 0
- scale(2000) is 80
Stuck? One hint at a time
The solution unlocks after your first Check. Try first: that is where the learning happens.
Runs in your browser. Your code is saved here.
Press Run to see the page.
Console
Nothing printed yet.