BestPromptFinder
HomeCoding › Below is an instruction that describes a task. Write a respo...

Below is an instruction that describes a task. Write a respo...

Coding · Gemini, GPT-5.6, Claude · Coding
40Quality
89%Useful
86Reliability

The prompt

Below is an instruction that describes a task. Write a response that appropriately completes the request. ### Instruction: Create a TicTacToe game in Python. ### Input: ### Output: class TicTacToe: def __init__(self): self.board = [['_' for _ in range(3)] for _ in range(3)] self.turn = 'x' def display(self): for row in self.board: print(' '.join(row)) def check_win(self): board = self.board # check if the player with the current turn has a row of three for row in self.board: if row.count(self.turn) == 3: return True # check if the player with the current turn has a column of three for col in range(3): if board[0][col] == board[1][col] and board[1][col] == board[2][col] and board[2][col] == self.turn: return True # check for the two diagonals if board[0][0] == board[1][1] and board[1][1] == board[2][2] and board[2][2] == self.turn: return True if board[0][2] == board[1][1] and board[1][1] == board[2][0] and board[2][0] == self.turn: return True return False
Find similar in the app →

Why this prompt

Source

Hugging Face

Related Coding prompts

PRD to MVP Technical Plan
Quality 93 · Claude Code
Full-Stack CRUD App Builder
Quality 93 · Claude Code
Legacy Refactor Planner
Quality 93 · Claude Code
Test Suite Generator
Quality 93 · Claude Code
Third-Party API Integration
Quality 93 · Claude Code
Database Schema and Migration
Quality 93 · Claude Code