Week 8 – 3/21/15

Next class we are going to be building structures in Minecraft. The code would look like something like this:
mc.setBlock(x, y, z, block_type)
So for example:
mc.setBlock(100, 200, 300, 3)
would mean to set a block at position:
x=100
y=200
z =300
block_type =3 —> dirt
I’d like you to write some code to print out numbers. In class I will show you how we can modify this code with very little extra code and build walls. It’s all about “for” loops.
Do a search on Google¬†for “python for loop and nested for loops” if you want a refresher. There are tons of good videos. It’s a great habit to use Google¬†to help you learn. I use it all the time.
A. write a program that will print out the following using a for loop:
1
2
3
4
5
6
7
8
9
10
B. Write a program that will print out the following using a nested for loop:
1 1
1 2
1 3
2 1
2 2
2 3
3 1
3 2
3 3

Leave a Reply