Giter Site home page Giter Site logo

josesaulguerrero / tic-tac-toe Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 538 KB

This is a simple tic-tac-toe built with React.

Home Page: https://funny-tic-tac-toe.netlify.app/

JavaScript 73.19% HTML 3.57% SCSS 23.24%
algorithm minimax-algorithm tic-tac-toe game react reactcontextapi sass preprocessor javascript workbox

tic-tac-toe's Introduction

Tic-Tac-Toe game

This is an amazing tic-tac-toe game where you can choose to play against a friend or against your computer πŸ€–. The computer uses the minimax algorithm to find the best move and way to play, so it's basically unbeatable 😎.

Table of contents

Overview

The challenge

Users should be able to:

  • Choose who they want to play against.
  • See who won after the game is over.
  • Restart the previous match after the game is over.
  • Reset the game configuration.

Screenshot

screenshot

Links

My process

Built with

  • Semantic HTML5 markup
  • Flexbox
  • Mobile-first workflow
  • Yarn - Node package manager
  • Webpack - Module bundler
  • Babel - JS code transpiler
  • React - JS library
  • Sass - For styles
  • Workbox - For managing the cache and service workers
  • react-app-rewired and customize-cra - These libraries modify the behavior of create-react-app and allow you to customize the webpack files. It must be used carefully because things can easily break.

What I learned

Building this project helped me learn to use and improve my knowledge and programming logic by:

  • Using the minimax algorithm to make your machine unbeatable.
  • Using React.Context to provide all the necessary functions.
  • Using pre-processors such as Sass.
  • Managing my service workers with Workbox.

Continued development

  • To make the computer "smarter" I use the minimax algorithm, which basically makes it unbeatable.

  • My stylesheets use Sass, a pre-processor that allows you to write cleaner CSS code and re-use your own style rules, so that you don't repeat yourself.

  • I used CSS pseudo-elements and pseudo-classes to create interesting animations when an unmarked cell is hovered.

  • To manage my service workers, I used Workbox, a set of libraries that google provides to help you covert your apps into PWAs that can be installed like a native app and work even when offline.

  • Implemented the @media (hover: hover) {} CSS media query, which is used to detect if the user's device has a cursor, to add hover transitions.

Useful resources

Author

tic-tac-toe's People

Contributors

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