An algorithm is a finite set of instructions that accomplish a task. All algorithms can be created by combining steps in three different ways.
Sequencing - Putting steps in an order

Selection - Deciding which steps to do next

Iteration - Doing some steps over and over

A Boolean is a primitive data type that can be either true or false.
The canMove(), isOnBucket(), and hasPaint() methods give us a boolean value that we can use to determine whether to repeat a set of instructions.
A while loop is a type of iteration statement.
An iteration statement is a control structure that repeatedly executes a block of code.
The condition of a while loop results in a boolean value (either true or false) and determines whether or not to execute the block of code.

If the condition is initially false, the loop body is not executed at all.