A visual reflection on time
You have lived about 0 weeks.
You may have about 0 weeks remaining.
You have completed about 0% of this life timeline.
"莫等闲,白了少年头,空悲切。"
很多人第一次看到这张「人生周数图」的时候, 都会突然意识到:时间其实过得比我们想象的要快。 这个「Life in Weeks」其实并不是什么神秘的软件, 它背后的逻辑和你们刚刚在课上学到的编程思想是一样的。 很多程序看起来很复杂,但本质上都可以拆成三个简单的步骤:
readLine()、readInt() 是一样的,
让用户把数据输入进来。
所以你会发现,一个看起来很有意思的小工具, 背后其实就是我们刚刚学到的几个基础概念: 输入 → 计算 → 输出。
接下来你们的挑战就是:尝试用你们现在学到的基础 JavaScript, 写一个属于自己的小程序。它不需要这么复杂, 甚至只用文字输出也可以,但核心思想是一样的。
Now it's your turn to build a small program. You don't need to create a visual page like this one. Instead, use the basic JavaScript skills you just learned to make a simple program that runs in the console and prints text results.
Your program should include three steps:
readLine(), readInt(), or readFloat().console.log().You can choose one of these ideas to implement:
You have lived about ___ weeks.
[x] [x] [x] [ ] [ ] [ ] [ ][x] for completed days.
Your program does not need to be complicated. As long as it follows the idea of Input → Calculation → Output, you have successfully built your own small program.