# 一、while循环 ```c++ while(循环到条件){ // 当条件成立的时候 // 执行循环到代码 } ``` **注意:**一定要记住循环到结构 # 二、熟练掌握while循环 ```c++ // 重复执行向右走两格 然后向上走两格 。。。。 while(true){ hero.moveRight(2); hero.moveUp(2); } ```