Giter VIP home page Giter VIP logo

tik-tak-toe's Introduction

TikTakToe


Project developed for the Full Stack Developer - Code Institute course, using Python 3 to build a game.

Tic-tac-toe or noughts and crosses is a game for two players who take turns marking the spaces in a three-by-three grid with X or O. The player who succeeds in placing three of their marks in a horizontal, vertical, or diagonal row is the winner.
In this game the player will play against an AI. But in future updates it will be possible to play against someone else.

Here is a live version of my project.



How to play


Tic-tac-toe is played on a three-by-three grid by two players, who alternately place the marks X and O in one of the nine spaces in the grid. You can also learn more about it on Wikipedia.
In this version the player will always make the first move with X, followed by a random CPU move with O. This will be until there is a winner or a tie, which is when all 9 spaces have already been filled and no one has managed to form a straight of 3.



Features


Existing Features


  • Board indication

    • At the beginning of the game, a board is presented with the values of their respective positions, ranging from 1 to 9, and a empty board.



  • Automatic indicators

    • When you start the game, making your first choice, the board will be updated, indicating your play and which options are free. The same will happen automatically after the CPU plays
    • Play against the computer
    • Accepts user input



  • Input validation and error-checking


- You cannot enter a valou outside of the board grid



- You must enter numbers



- You cannot enter the same guess twice



- You cannot enter the same CPU guess



- Play agin or quit game



  • Future Features

    • Have a two player option.
    • Let the player select difficulty levels against the CPU.
    • Let the player select who starts playing.


Back to the top

Testing


I have manually tested this project by doing the following:

  • Passed the code through a PEP8 linter and confirmed there are no problems
  • Given invalid inputs: out of bounds inputs, same input twice
  • Tested in my local terminal and the Code Institute Heroku terminal.

Bugs

Solves Bugs

  • When I wrote the code, when entering a value above the number of positions or a string or even a already played value, it broke, making it impossible to continue. When I change the choice input logic this bug was solved.

Unfixed Bugs

  • No unfixed bugs

Validator Testing

  • PEP8
    • No errors were returned from PEP8online.com

Deployment


This project was deployed using Code Institute's mock terminal for Heroku.
  • Steps for deployment:
  • Fork or clone this repository
  • Create a new Heroku app
  • Set the buildbacks to pytho and NodeJSin that order
  • Link the Heroku app to the repositoryß
  • Click on Deploy

Credits

  • Code Institute for the deployment terminal
  • Wikipedia for the details of the Tik Tak Toe game
  • A special thanks to my mentor Martina, who helped me solve the bug and contributed ideas to improve the code.

Back to the top

tik-tak-toe's People

Contributors

pembarach 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.