tic_tac_toe

psychedelic techno, dubstep, boom bap p-funk, groovy instrumental introduction

May 24th, 2024suno

Lyrics

[Instrumental Introduction def print_board(board): """Prints the current state of the board.""" for row in board: print(" | ".join(row)) print("-" * 5) def check_winner(board, player): """Checks if the given player has won.""" # Check rows, columns, and diagonals for i in range(3): if all([spot == player for spot in board[i]]) or all([board[j][i] == player for j in range(3)]): return True if board[0][0] == board[1][1] == board[2][2] == player or board[0][2] == board[1][1] == board[2][0] == player: return True return False [Instrumental] def check_draw(board): """Checks if the game is a draw.""" return all([spot in ["X", "O"] for row in board for spot in row]) def tic_tac_toe(): board = [[" " for _ in range(3)] for _ in range(3)] current_player = "X" while True: print_board(board) row = int(input(f"Player {current_player}, enter the row (0, 1, 2): ")) col = int(input(f"Player {current_player}, enter the column (0, 1, 2): ")) [Instrumental] if board[row][col] == " ": board[row][col] = current_player else: print("That spot is already taken. Try again.") continue if check_winner(board, current_player): print_board(board) print(f"Player {current_player} wins!") break if check_draw(board): print_board(board) print("The game is a draw!") break [Instrumental] current_player = "O" if current_player == "X" else "X" if __name__ == "__main__": tic_tac_toe() [Instrumental] [End]

Empfohlen

Crimson Sands of Fate
Crimson Sands of Fate

symphonic metal epic haunting

Volcano Dreams
Volcano Dreams

playful upbeat electronic

Wolken im Kopf
Wolken im Kopf

clear voice german cloud rap trap

The Endless Expanse
The Endless Expanse

Space, ambient, suspenseful, dubstep, stressful, destructive

Il faisait de la moto debout 🏍️🎸
Il faisait de la moto debout 🏍️🎸

black metal, death metal, industrial, aggressive, male voice, bass, heavy guitar riffs, rebel, evil, dark, biker

Sötét Éj
Sötét Éj

kemény hip-hop sötét

A Bimble Lost and Found
A Bimble Lost and Found

folk-pop whimsical acoustic

My Lil' One
My Lil' One

Energic Guitar Intro, Math Rock, middle east vibes, male vocal, moderato

Bertemu Tuhan Yesus
Bertemu Tuhan Yesus

pop fast tempo

Música Dance
Música Dance

Upbeat, Disco, Funk Ritmo: 4/4 , batería constante hi-hat. bajos prominentes, guitarras rítmicas, teclados, sintetiza

Pixel Love
Pixel Love

8-bit chiptune electronic

Az Okinawai szerető 80s
Az Okinawai szerető 80s

80s,Hard rock,80s,metal

Moonlight Drive
Moonlight Drive

lofi chill mellow

Desamor en Salsa
Desamor en Salsa

sentimental rítmica salsa

Asas Abertas
Asas Abertas

female voice, bass, rap, male voice, emotional

Moonlit Dreams
Moonlit Dreams

sleep traditional chinese instrumental serene guzheng