Tuesday 20 September 2011

Pyramid Size

Yesterday I finished building the smallest pyramid of the great pyramids in minecraft, and today I did some maths telling me how many blocks were in the pyramid. What I did was find out how many blocks the first layer was to a side (which was 50 ) , multiply the number by itself(squaring), and then take two off of the first number(the number of blocks per side), to find out how many blocks there were to a side one layer higher. Also, I found a convenient algorithm(mathematical pattern.) There was a difference of 196 blocks between the amount of sandstone in the first layer and the second layer. The next difference was 188 blocks. I continued finding out the difference, and I noticed a pattern. The differences became 8 smaller(eight less blocks of difference) every sum I got closer to the finish. So I used this cleverly. I would take the last difference, subtract 8 from it, and then take the result off of the last answer. My final answer to how many blocks there were in the pyramid was 22100 blocks, An awful lot.
This is the smallest pyramid . . . the biggest is twice as big. Then afterwards I wrote a tiny, 5-10 line program that did half an hour's worth of work from my side in 0.000005 seconds(or ridiculously fast, anyway ). Here it is, in DarkBASIC.


_____________________________________________________________________________________


For x=50 to 2 step -2

Tempanswer=x*x
Answer=answer+tempanswer
next

text 20,20, (answer)


_____________________________________________________________________________________

No comments:

Post a Comment