+ 1
Who solved snail 🐌 project in Javascript?
And how
2 Antworten
+ 4
Please share your attempt here so we may assist.
A common method is to use a while loop which will break when the snail reaches more than the height of the bucket.
while (depth < height)
Each day he climbs 7 // depth +=7
day +=1
check to see if he is outside.
if not: depth -=2
while loop starts again
When the loop breaks, print the days
+ 3
Note: There is a search option🔎 in Sololearn discuss section (in top right corner). That search option should be used everytime before asking a question.