1. Tic-Tac-Toe: Using jQuery, Bootstrap, HTML, CSS and PHP

    • Buy now
    • Learn more
  2. INTRODUCTION

    • Preparing the development environment
  3. CREATING THE GRID

    • Setting up the HTML Page
    • Setting up the Tic-Tac-Toe grid
    • Styling the Tic-Tac-Toe grid
    • Adding button tracking code
  4. PLAYER SELECTIONS

    • Dealing with human player selections
    • How to generate a random number
    • Dealing with computer player selections
    • Adding a delay between human and computer selections
    • Enabling and disabling buttons
  5. CHECKING WINNING COMBINATIONS

    • Adding an array of winning combinations
    • Parameters and Arguments
    • How to iterate through an array using jQuery
    • Check for a win - the main logic
    • Final tweaks
    • Displaying the Win or Lose Message
  1. Products
  2. Course
  3. Section
  4. Lesson

How to generate a random number

  1. Tic-Tac-Toe: Using jQuery, Bootstrap, HTML, CSS and PHP

    • Buy now
    • Learn more
  2. INTRODUCTION

    • Preparing the development environment
  3. CREATING THE GRID

    • Setting up the HTML Page
    • Setting up the Tic-Tac-Toe grid
    • Styling the Tic-Tac-Toe grid
    • Adding button tracking code
  4. PLAYER SELECTIONS

    • Dealing with human player selections
    • How to generate a random number
    • Dealing with computer player selections
    • Adding a delay between human and computer selections
    • Enabling and disabling buttons
  5. CHECKING WINNING COMBINATIONS

    • Adding an array of winning combinations
    • Parameters and Arguments
    • How to iterate through an array using jQuery
    • Check for a win - the main logic
    • Final tweaks
    • Displaying the Win or Lose Message