Add code golf challenges for Vim practice, a weekly review template, and extend the cheatsheet with high-frequency commands. Fix the calculator `multiply` implementation and correct a logger import path.
44 lines
1.2 KiB
TypeScript
44 lines
1.2 KiB
TypeScript
// ============================================================
|
|
// Code Golf 场景 3:批量加注释
|
|
// ============================================================
|
|
//
|
|
// 目标:给三个函数上面各加一行注释 "// Arithmetic operation: <函数名>"
|
|
//
|
|
// 💡 提示:用宏!q a 开始录制 → 在第一行编辑 → j → q 停止 → @a 回放
|
|
// ============================================================
|
|
|
|
function add(a: number, b: number): number {
|
|
return a + b;
|
|
}
|
|
|
|
function subtract(a: number, b: number): number {
|
|
return a - b;
|
|
}
|
|
|
|
function multiply(a: number, b: number): number {
|
|
return a * b;
|
|
}
|
|
|
|
// === 目标代码 ===
|
|
//
|
|
// // Arithmetic operation: add
|
|
// function add(a: number, b: number): number {
|
|
// return a + b;
|
|
// }
|
|
//
|
|
// // Arithmetic operation: subtract
|
|
// function subtract(a: number, b: number): number {
|
|
// return a - b;
|
|
// }
|
|
//
|
|
// // Arithmetic operation: multiply
|
|
// function multiply(a: number, b: number): number {
|
|
// return a * b;
|
|
// }
|
|
//
|
|
// ============================================================
|
|
// 我的最佳成绩:
|
|
// 日期: ________ 按键数: ________
|
|
// 操作日志: ________________________________
|
|
// ============================================================
|