Git Product home page Git Product logo

kat-e-peri / microsoft-codess-project-team-rocket Goto Github PK

View Code? Open in Web Editor NEW

This project forked from saumyasingh203/microsoft-codess-project-team-rocket

0.0 0.0 0.0 31.27 MB

🚀 This is the main repository for the Microsoft Codess Mars Colonization project made by Team ROCKET. The project has a frontend in HTML and CSS with a backend in Python integrated using Flask 👩‍🚀

JavaScript 14.44% Python 31.81% CSS 31.37% HTML 22.31% Procfile 0.07%

microsoft-codess-project-team-rocket's Introduction

MICROSOFT Codess Project : Team-ROCKET

TABLE OF CONTENTS

  • Introduction
  • Product Description
  • Technologies
  • Flowchart
  • Setup, Installation and Launch
  • User Journey
  • Support

INTRODUCTION

Tic-tac-toe (also known as noughts and crosses, three in a row, or Xs and Os) is a game for two players wherein each player takes turns marking the spaces, conventionally, in a 3x3 grid. The player that succeeds in placing three of their marks in either a horizontal, vertical, or diagonal row wins the game.

The above GIF shows a sample game of Tic-Tac-Toe on the web-application.

PRODUCT DESCRIPTION

Background

Microsoft’s Engage 2020 Mentorship Program aimed at equipping the students selected as mentees with the most up to date information in the field of Artificial Intelligence after having built a foundation for the same. The project undertaken by Team Rocket, a web-based application, has been designed to be an entertainment tool to be used by the crew of the Mars Colonization Project. The goal was to design a game of tic-tac-toe that utilised the concepts and principles of artificial intelligence with an original feature(s) or unique aspect(s) that set the project apart from that of others. The game has been developed to be played by a single player (the user) against the Team Rocket AI. The application contains varying levels of depths for the player to choose from (with level 1 being the easiest for the player to beat as opposed to the maximum depth where the computer is undefeatable) that helps showcase the capabilities of the AI.

Algorithm Used

The application makes use of the MINIMAX algorithm– it is an algorithm that is conventionally used for games that are played on a turn by turn basis, such as tic-tac-toe, chess, backgammon, etc. The backtracking algorithm, used in game theory and decision making, minimises the player’s losses and maximises his wins. It considers the present state of the game and the moves available, then for each valid move it plays (alternating between min and max) until it finds a terminal state (win, draw or lose).
The above image displays a partial game tree for Tic-Tac-Toe. Credits to Professor Eppstein of UC Irvine.

TECHNOLOGIES

The project has been created with the use of:

  • HTML
  • CSS
  • JavaScript
  • Python
  • jQuery
  • MongoDB

FLOWCHART


LAUNCH

Visit https://microsoft-team-rocket.herokuapp.com to access the deployed game.

Setup and Installation

In order for the user to set up the game on their local machine, they are required to have Python3.5 (or a newer version) and a few dependencies installed. To set up the application, they are required to follow the following steps:

  1. Clone the repository
  2. Open the terminal window and execute the following command to install flask– a Python micro web framework that we have used on the backend.
    pip install flask
  3. Execute the following command to move into the 'address' directory.
    cd address
  4. Execute the following commands to install pymongo and dnspython– doing so will help you access the "leaderboard" database and consecutively view the leaderboard upon running the application on your local machine.
    pip install pymongo
    pip install dnspython
  5. Run the following command to launch the flask application.
    python ttt_integrated.py
  6. After executing the previous command, the following will be displayed:

    This means that the website is successfully running on the local machine. Copy and pasting the link into the search bar of your browser will help you launch the web application on your local machine.

ADDITIONAL FEATURES

Human Start and AI start

Once the user has clicked on the "Let's Play" button on the pop up appearing the home screen - prompting them to enter their details and to leave a message - they are lead to the game screen. Here, the user has a choice between the choice of levels and then between "AI start" and "Human start"; which will decide who will make the first move.
The below given GIF shows an instance of the player making the first move.

In comparision to the above given GIF, the one given below shows an instance of the Team Rocket AI making the first move.

Leaderboard Database

The web application computes the scores as 5,-1, and 0 for a win, loss, and a tie respectively. The database makes use of emails as a unique key identifier which allows it to maintain the scores for the returning users. The leaderboard is displayed as follows:

Upon successfully running the website on your local machine, typing the following into the search bar of your browser will display the database page.
localhost:5000/database
This will allow the user to view the comments left behind by the visitors along with their scores. The data stored in the database is then displayed as follows:

USER JOURNEY

The GIF given below can act as a visual guide help the user navigate through the web application with ease.

In the previous demonstration, we see that a player playing against the AI at the max depth has a greater chance of losing or tying the game. The instance given below shows that such is not to be the case when playing at a level 1 depth (for it is easier to beat the AI at level 1 as opposed to the maximum depth).


SUPPORT

For any queries or problems that might arise with regards to the project, the authors can be contacted at [email protected]

microsoft-codess-project-team-rocket's People

Contributors

aashnaj123 avatar dependabot[bot] avatar saumyasingh203 avatar vidushiy21 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.