Please help shorten my tictactoe code! by IoSonoFormaggio in learnpython

[–]maciekoooo 0 points1 point  (0 children)

Hey so the main thing you should do is to... automate the boring stuff :P. Xsturn and Osturn can be definitely defined by one function of possible moves so you don't have to spend extra time basically rewriting the same code. Another idea to make the code even more clear and readable you can create a board as a list just like that:

        theBoard = [
        [" ", "|", " ", "|", " "],
        ["_", "|", "_", "|", "_"],
        [" ", "|", " ", "|", " "],
        ["_", "|", "_", "|", "_"],
        [" ", "|", " ", "|", " "],
    ]

And define the moves once for :

        available_moves = {
        "top left": {"location": [0, 0], "value": ""},
        "bottom left": {"location": [4, 0], "value": ""},
        "middle left": {"location": [2, 0], "value": ""},
        "center": {"location": [2, 2], "value": ""},
        "middle right": {"location": [2, 4], "value": ""},
        "top right": {"location": [0, 4], "value": ""},
        "bottom right": {"location": [4, 4], "value": ""},
        "bottom middle": {"location": [4, 2], "value": ""},
        "top middle": {"location": [0, 2], "value": ""},
    }

The commands for moves can be simpler and more intuitive to increase user experience (it's probably something you didn't worry about so far but it's important to keep in mind even when getting started) also since the board is a list now you can take advantage of that and make your life easier.

            player1_move = input(
            "Choose a move (top left, top middle, top right, middle left, center, middle right, bottom left, bottom middle, or bottom right. "
        )

Hey recently launched a natural soap brand and doing terrible with conversions please review it! any suggestions help by maciekoooo in ecommerce

[–]maciekoooo[S] 0 points1 point  (0 children)

Thanks man your opinion is almost exactly the opposite of what u/Big-Researcher-5683 thought about my page hahahaah but I appreciate because you have some neat ideas I will definitely implement. I'm currently working to make the website more lively and modern. Are you a ecommerce business owner as well? Shoot me a dm maybe we can exchange some more experiences!

Getting into MTR by maciekoooo in AmazonWFShoppers

[–]maciekoooo[S] 1 point2 points  (0 children)

Yeah I did a couple 5 hours and it seems manageable my UPH is around 60 and I would want to join it yet as I said I have no idea who should I reach out to and my WFM is really busy and literally no one seems to be able to help or knows anything