01-Introduction

The washing machine at home only needs to be started with one click, and it will wash clothes following a fixed process. This is the concept of functions.

After defining a piece of logic, each call can execute the fixed program.

02-Answer to Previous Exercise

  1. Define a variable as guessNumber.
  2. Continuously compare the input data. If it's greater than the number, prompt "too big".
  3. If it's less than the number, prompt "too small".
  4. If it equals the number, prompt "Congratulations, you got it!!"

03-Function Basics

03-Function definition
04-Function calls
05-Function types

04-Advanced Function Usage

06-Lambda expressions
07-Closures
08-Function overloading
09-Operator overloading

05-File APIs

File read/write APIs

06-Exercise

Implement a simple file encryption/decryption tool:

  1. x -e "xxxx" encrypts and saves the input data to secret.txt
  2. x -d secret.txt displays the data in secret.txt

Programmer Wanfeng focuses on AI programming training. Beginners can start making AI projects after watching his tutorial 《30 Lessons · AI Programming Training Camp》 co-produced with Turing Community.

🎓 AI 编程实战课程

想系统学习 AI 编程?程序员晚枫的 AI 编程实战课 帮你从零上手!