Created
February 22, 2018 22:12
-
-
Save richardbwest/416c8fd124ead2b9d2c10f1af94abc4c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import mcpi.minecraft as minecraft | |
import mcpi.block as block | |
import time,math | |
mc = minecraft.Minecraft.create() | |
mc.postToChat("Rainbow World") | |
pos = mc.player.getTilePos() | |
#red, orange,yellow,green,blue,indigo,violet | |
rainbow = [14,1,4,13,11,10,2] | |
radius = 30 | |
#for i in range(16): | |
# mc.setBlock(pos.x,pos.y + 2,pos.z + i,block.WOOL.id,i) | |
for angle in range(360): | |
for i in range(len(rainbow)): | |
x = pos.x + (radius - i) * math.cos(angle*math.pi/180) | |
y = 0 + (radius - i) * math.sin(angle*math.pi/180) | |
mc.setBlock(x,y,pos.z,block.WOOL.id,rainbow[i]) | |
time.sleep(0.2) |
Hi,
You're correct, although I think perhaps I put that in as a placeholder for
a future amendment ( substituting 0 for the Y centre coordinate?)
Either way 0+ is a pretty redundant!
Cheers,
Richard
…On Tue, 1 Oct 2019 at 00:42, Fred. ***@***.***> wrote:
Hi,
Are you sure about the y formula? y = 0 + (radius - i) why are you adding
0 to (radius -i)? instead of writing solely (radius - i)?
Fred
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<https://gist.github.com/416c8fd124ead2b9d2c10f1af94abc4c?email_source=notifications&email_token=ABAL3DCRTRSXSKL5RCZRRBDQMI277A5CNFSM4I36HIGKYY3PNVWWK3TUL52HS4DFVNDWS43UINXW23LFNZ2KUY3PNVWWK3TUL5UWJTQAFZUHW#gistcomment-3041403>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABAL3DFU2QK53VCK6Y6DHXTQMI277ANCNFSM4I36HIGA>
.
--
Mr West
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
Are you sure about the y formula? y = 0 + (radius - i) why are you adding 0 to (radius -i)? instead of writing solely (radius - i)?
Fred