#๐ How make tictactoe
51 messages ยท Page 1 of 1 (latest)
@unkempt swallow
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
Via pydroid
Cuz i aint got a better engine/know any for mobile
@rancid grove :?
ur only option is to use input and print
many ways to make the grid, u can have a string, a list or a list of lists
and a lot more options but those the 3 usual solutions
x | x | x
โโโ+โโโ+โโโ
x | x | x
โโโ+โโโ+โโโ
x | x | x
print(" {} | {} | {} ".format(" ", "x", "o"))
How does thid work
.format is one of many ways to format a string, in this case its putting an empty string at first {} an x at 2nd {} and a o at the 3rd {}
!e
print(" {1} | {0} | {2} ".format(" ", "x", "o"))
:white_check_mark: Your 3.13 eval job has completed with return code 0.
x | | o
u can also specific where stuff lands
the 0th aka empty string now goes on middle, the next which is x goes on the left and the last o goes on right
because of the 0 1 2
!e
print(" {} , {} , {} ".format("b", "a", "n"))
:white_check_mark: Your 3.13 eval job has completed with return code 0.
b , a , n
:x: Your 3.13 eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File [35m"/home/main.py"[0m, line [35m1[0m, in [35m<module>[0m
003 | print([31m" {} {} {} {} {} ".format[0m[1;31m("a", "b")[0m)
004 | [31m~~~~~~~~~~~~~~~~~~~~~~~~~[0m[1;31m^^^^^^^^^^[0m
005 | [1;35mIndexError[0m: [35mReplacement index 2 out of range for positional args tuple[0m
What
5 formatting slots but only 2 elements given for format
Oh
Ok so
Could i theroetically
Create a format grind filled with variables and use number fir the varibles to declare them as x o or empty?
hey ๐
Hey
Im gonna be at schol soon
So ill be back in 7hrs
And makes this again
Cya
Bye dagger
cya
ok

This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.