Skip to content · ⁨الانتقال إلى المحتوى⁩

Tic-tac-toe winner · ⁨فائز لعبة X O⁩

English

Tic-tac-toe winner

Decide a game of noughts and crosses from the board.

There are eight lines to check: three rows, three columns and two diagonals. board[r][c] is the square in row r and column c, so a column is board[0][c] + board[1][c] + board[2][c]. Collect all eight lines as three-letter strings, then look for "XXX" or "OOO".

العربية

فائز لعبة X O

تحديد الفائز في لعبة X O من اللوحة.

هناك ثمانية خطوط للتحقق منها: ثلاثة صفوف وثلاثة أعمدة واثنان قطريين. board[r][c] هو المربع في الصف r والعمود c، لذا العمود هو board[0][c] + board[1][c] + board[2][c]. اجمع جميع الخطوط الثمانية كسلاسل ثلاثية الأحرف، ثم ابحث عن "XXX" أو "OOO".

Log in or create account · ⁨تسجيل الدخول أو إنشاء حساب⁩

IGCSE, A-Level & AP