Skip to main content

Create a List of Positions

Comments

3 comments

  • Michael Reilly
    places = []
    start: Position = None
    nextPlace: Position = None

    agent.teleport(pos(0, 0, 1), SOUTH)
    start = agent.get_position()
    for x in range(3):
        agent.move(FORWARD, 1)
        nextPlace = agent.get_position()
        places.append(nextPlace)
        
    player.say(places)
    0
  • Michael Reilly

    (That code DOES work, not sure why but happy and sharing.)

    0
  • Debbie Alexander
    Moderator Beacon of Knowledge Super Star

    Good to know that you wrestled that code to the ground and made it conform! sometimes I feel like I have to do some serious cattle wrestling to get my code to do what I wanted to do but in the end I win. lol
    So in terms of the user experience what you're wanting them to do is select a spot for their tic tac toe choice right? and then a block would be placed there. So the player would play against the agent essentially. It  seems that you would want a vertical board rather than a horizontal board. It might be easiest if the blocks were numbered, and then when the players were choosing a location to put their tic tac toe on, they could just say I'm putting my block on block 3. does that make sense? just my random brainstorming ideas. I'd love to know how this idea works out! come back and let us know. Happy coding!

    0

Please sign in to leave a comment.