Chapter 3: For Loop

Now that you can build separate blocks by calling game.setBlock() function, let's think about how we can build a fence containing 100 blocks. Wouldn't it be boring to call the same function 100 times?

Instead, what if we could just tell the computer to build 100 blocks at a time? This can be done using a loop. With a loop, we can ask the computer to repeat a task as many times as we wish.

results matching ""

    No results matching ""