From 7eba0301dcfde2b587aceb8f32b005a831b71c2c Mon Sep 17 00:00:00 2001 From: Rh17S15 Date: Mon, 22 Sep 2025 19:43:51 +0200 Subject: [PATCH] Added field, and a basic field-printing-function --- tictactoe.py | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/tictactoe.py b/tictactoe.py index e69de29..c583964 100644 --- a/tictactoe.py +++ b/tictactoe.py @@ -0,0 +1,32 @@ +# first two player tictactoe then one player against ai +# Ich hab jetzt einfach mal ohne OOP(bzw MVC/MVP) angefangen. +# Ich denke es ist einfacher es erst so zu machen und dann einzuteilen. + + +field = [[" ", "|", " ", "|", " "], + ["—", "+", "—", "+", "—"], + [" ", "|", " ", "|", " "], + ["—", "+", "—", "+", "—"], + [" ", "|", " ", "|", " "]] + + +def printer(): # function that prints the field + + print(" 0 1 2", end="\n") + for j in range(0, len(field)): + print("0" if j == 0 else "1" if j == 2 else "2" if j == 4 else " ", end=" ") + for k in range(0, len(field)): + print(str(field[j][k]), end=" ") + print("\n", end="") + + +def turn(): # function that checks whoose turn it is and where they can place their symbol + print("penis") + + +player1_char = "X" +player2_char = "O" + +print("Willkommen zu Kat&Paul's TicTacToe:") + +printer()