1 files modified
2 files added
1 files renamed
New file |
| | |
| | | position = [ |
| | | (0,0), (0,1), (0,2), (1,0), (2,0) |
| | | ] |
| | | p = position[5] |
| | | print(p) |
New file |
| | |
| | | def is_in_Bereich(x, a, b): |
| | | return (x >= a and x <= b, a, b) |
File was renamed from ub-3/tictaktoe.py |
| | |
| | | print("Eingabe nicht in Ordnung") |
| | | |
| | | |
| | | def pruefe_comination(p, board): |
| | | def pruefe_combination(p, board): |
| | | r = p[0] |
| | | c = p[1] |
| | | combination = p[2] |
| | |
| | | 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 |
| | | |
| | |
| | | return (empty_cells == 0, 0) |
| | | |
| | | |
| | | |
| | | |
| | | print_tafel(tafel) |
| | | aktuelle_spieler = 1 |
| | | |
| | |
| | | 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) |