Code Monkey home page Code Monkey logo

2coursmidtermexam's Introduction

2coursMidtermExam

Tic-tac-toe - What is the current state of the game? In a game of Tic-Tac-Toe, two players take turns marking an available cell in a 3-by-3 grid with their respective tokens (either X or O). When one player has placed three tokens in a horizontal, vertical, or diagonal row on the grid, the game is over and that player has won. A draw (no winner) occurs when all the cells on the grid have been filled with tokens and neither player has achieved a win. More details on the game here : https://en.wikipedia.org/wiki/Tic-tac-toe Problem statement: Given a string of ‘X’, ‘O’ and ‘-’ as input, which represents a game board, print the state of the game as output. The states must be one of: • X wins • O wins • Draw • Game in progress • Invalid grid

image

Examples :

X wins - when X occupies either all cells in a vertical line, or all cells in a horizontal line, or all cells in a diagonal. Sample Input : XOXXOOXXO. Sample Output : X wins!.

O wins - when O occupies either all cells in a vertical line, or all cells in a horizontal line, or all cells in a diagonal. Sample Input : XOOXOXOXO. Sample Output : O Wins!.

Draw - no player has won. Sample Input : OXOXOXXOX. Sample Output : Its a draw!.

Game in progress - if no player has won and its not a draw. Sample Input : XOXX--O--. Sample Output : Game still in progress!.

Invalid Grid - a grid thats not possible to achieve in a real game. Sample Input : XXXOOOXXO. Sample Output : Invalid game board.

image

Ruslan agai i did this last 12 ours i could do only screenshots and readme olso ""jar"" files in very optimistic variant i could get only 40p thats meen i am fail

but i would ask you to put me at least get a passing score PLEASE !

2coursmidtermexam's People

Contributors

saitama9857 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.