MakeCode "on_chat" functions allowing more than number arguments.
Currently MakeCode only allows number arguments when entering a function from chat command. It would be good to allow other inputs such as block types etc.
For example:
The following function has too arguments for the colours used in the spiral. On chat command it has to be their block ID entered as a number. Most students won't have these memorised so it would be great to allow other arguments than just numbers such as block types or strings.
def spiral(dimension: number, block1: block, block2: block):
builder.teleport_to(pos(0, 0, 0))
builder.face(EAST)
builder.shift(dimension / 2, -1, dimension / 2)
builder.mark()
builder.shift(-dimension, 0, -dimension)
builder.fill(block1)
builder.mark()
while dimension > 0:
builder.move(FORWARD, dimension)
builder.turn(TurnDirection.LEFT)
dimension -= 1
world(0, 0, 0)
builder.trace_path(block2)
0
Please sign in to leave a comment.
Comments
0 comments