Hong-Phuc Bui
2025-05-13 f6870cf5596375bf07be2f611f538d92f7f3cae8
ue4, tictactoe
1 files modified
2 files added
1 files renamed
31 ■■■■■ changed files
ub-3/bsp-list-of-tupel.py 5 ●●●●● patch | view | raw | blame | history
ub-3/bsp-return.py 2 ●●●●● patch | view | raw | blame | history
ub-3/tictactoe.py 7 ●●●● patch | view | raw | blame | history
ub-3/tictactoe.test.py 17 ●●●●● patch | view | raw | blame | history
ub-3/bsp-list-of-tupel.py
New file
@@ -0,0 +1,5 @@
position = [
        (0,0), (0,1), (0,2), (1,0), (2,0)
    ]
p = position[5]
print(p)
ub-3/bsp-return.py
New file
@@ -0,0 +1,2 @@
def is_in_Bereich(x, a, b):
    return (x >= a and x <= b, a, b)
ub-3/tictactoe.py
File was renamed from ub-3/tictaktoe.py
@@ -41,7 +41,7 @@
            print("Eingabe nicht in Ordnung")
def pruefe_comination(p, board):
def pruefe_combination(p, board):
    r = p[0]
    c = p[1]
    combination = p[2]
@@ -70,8 +70,9 @@
    for p in position:
        r = p[0]
        c = p[1]
        print(p, player)
        if board[r][c] == player:
            return pruefe_comination(p, board)
            return pruefe_combination(p, board)
        else:
            return False
    
@@ -99,6 +100,8 @@
    return (empty_cells == 0, 0)
                
                
print_tafel(tafel)
aktuelle_spieler = 1
ub-3/tictactoe.test.py
@@ -1 +1,16 @@
import
from tictactoe import pruefe_comination, has_spieler_gewonnen, PL1, PL2, EMPTY
test_board = [
    [PL1,   PL1, PL1],
    [EMPTY, PL2, EMPTY],
    [EMPTY, PL2, EMPTY]
]
result = pruefe_comination( (0,0,"hvd"), test_board )
print(result)
result = has_spieler_gewonnen(PL1, test_board)
print(result)