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