
Design and code a tic tac toe game where the user faces an unbeatable AI powered by JavaScript, canvas, and the minimax algorithm.
Explore the basics of artificial intelligence and how ai can think, learn, and grow beyond programmed commands while building a simple two-player tic tac toe ai.
Explore artificial intelligence as a program of code that mimics human problem solving, from playing chess to driving, and learn how AI tackles real-world problems.
An intelligent agent perceives the environment with sensors, understands its state, and uses actuators to affect the environment; the agent function is the brain guiding problem solving and decision making.
Explore the driving problem in autonomous taxis for game development by modeling an AI driver that perceives traffic through sensors and cameras, analyzes the environment, and acts via actuators.
Explore how an automated vacuum cleaner uses sensors to detect dust, avoid obstacles, and navigate the floor to clean efficiently.
Explore the four artificial intelligence environment categories and their two subtypes: fully observable and partially observable, with tic tac toe as fully observable.
Explore deterministic and stochastic environments, discrete versus continuous settings, and adversarial contexts, using tic tac toe and minimax-based AI examples.
Understand the minimax algorithm in fully observable two-player games, and see how the AI evaluates future moves to choose optimal plays for tic tac toe, guiding an unbeatable AI.
Explore the technicalities of the minimax algorithm, including maximizing and minimizing players and the minimax tree, to understand artificial intelligence decisions in tic tac toe.
Explore how the minimax algorithm drives decision making in a simple maximum number game, illustrating maximizing and minimizing nodes, game states, and value propagation.
Demonstrates the minimax algorithm evaluating a game tree with maximizing and minimizing turns, identifying the optimal next move (left node) and how AI and human players influence outcomes.
This lecture uses a tic tac toe example to show the minimax algorithm, with final states of win, loss, or draw coded as 1, -1, and 0.
Explore the minimax algorithm in a tic tac toe scenario, analyzing left and right branches, building the game tree, and selecting moves that maximize the AI's win chances.
Discover how the minimax algorithm guides the tic tac toe ai through a game tree to select the optimal move, producing wins or draws against the human player.
Explain the minimax algorithm fundamentals for tic tac toe, detailing key terms like initial state, actions, results, terminal states, utilities, and how a game tree guides the max player's moves.
Explore the minimax pseudocode for tic-tac-toe, using a terminal function and recursion to evaluate actions from the current game state and back up utilities to choose the optimal move.
Apply the minimax algorithm to a tic tac toe game to drive the AI's optimal moves, tracing the game tree and terminal utilities.
Apply the minimax algorithm to a tic tac toe game tree, tracing utilities to reveal the AI's optimal next move and the role of max, min, and first-option tie-breaking.
Create the HTML5 skeleton for the tic tac toe game by declaring the doctype, html, head, and body, and set the page title while using live preview in brackets.
Explore how meta tags in the HTML5 head section shape page metadata, charset, and viewport settings to improve search ranking and responsive display across devices.
Create the header section with a heading inside a header tag and assign a unique id, then establish a separate result area for JavaScript to display game results.
Create a game area and rules section beneath the header using header, section, and div tags with IDs game and rules to structure block-level sections.
Create nine 100x100 canvases arranged in a 3x3 grid with unique IDs, using breaks to form rows, and add a centered new game button.
Create the final rules section by building the heading level two and three paragraphs, then refine the canvas area to display the rules for the Tic Tac Toe AI game.
Link an external stylesheet to your html file, explain external vs internal stylesheets, and use a link tag with rel stylesheet to apply css to page elements.
Style web pages by selecting elements with CSS, applying background colors, and using hex values and color pickers. Compare hatch vs body selectors to apply a page-wide background.
Apply the universal selector to reset browser defaults, then center the header text and set spacing for a consistent tic tac toe AI game interface.
Style headings in a tic tac toe UI by targeting unique IDs like head and reserved, applying font size, font family, color, and margins.
Style all nine canvases by adding a solid border, a background color, and basic alignment to make the Tic Tac Toe grid clearly visible for drawing.
Style the entire game area by structuring layout with section and div containers, applying relative positioning, fixed widths of 320px, and centering the canvas and button for responsive design.
Style the divs that hold the canvases and rules area by adjusting container dimensions, changing display to inline-block and using floats to align side by side.
Style the app's content by applying consistent typography and spacing to paragraphs and heading 2 elements, using font sizes, margins, and color for a cohesive UI.
Style the new game button with a top margin, a 20px bold font, lime green background, and a 1px black border, while applying hover effects and correct CSS syntax.
Explore hover effects on canvases and the new game button using CSS hover selectors to change background colors, and prepare for future JavaScript interactivity.
Implement design enhancements by brightening the background to yellow, mesh and align nine canvases into a seamless tic tac toe grid, and switch canvases to block with left alignment.
Refine the Tic Tac Toe game UI by adjusting borders, padding, and canvas layout; align outer and inner borders, and prepare a shadowed new game button for the next lesson.
Enhance the tic tac toe game's UI by adding a realistic button shadow, tuning margins, borders, and border radius, and explaining box-shadow parameters and cross-browser prefixes.
Learn the basics of javascript and canvas, and how to connect html files with external scripts for tic tac toe ai game development using script tags and bottom-of-page loading.
Discover how variables act as containers for information, storing strings, numbers, and booleans, and learn to declare them with var, follow naming rules, and end statements with semicolons.
Learn JavaScript basics for arithmetic and comparison operators, including modulo and the plus-equals shorthand, and display results with alert messages.
Explore conditional statements in JavaScript, focusing on if and else structures, switch statements, and comparison operators to execute code blocks based on true conditions, with examples and comments.
Explore switch statements as a versatile conditional alternative to if statements, accepting multiple cases and executing code based on the matching case, with breaks and an optional default.
Master the for loop in javascript: initialize a variable, set a condition, and increment, to repeat statements until the condition fails, demonstrated by printing 1 to 5.
Learn to use one-dimensional arrays to store multiple values, access elements by zero-based indices, and modify specific positions, including numbers, strings, and booleans.
Explore two dimensional arrays where a parent array holds multiple child arrays, each with three values, and learn to access elements with two indices.
Explore how functions organize code in JavaScript by defining reusable blocks with function definitions and function calls, including passing arguments, returning values, and reusing a single block across multiple executions.
Explore the document object model and learn to manipulate the DOM using getElementById and innerText to build a dynamic tic tac toe game interface.
This lesson teaches how to create and handle click events in the DOM by using getElementById and addEventListener on a button, preparing tic tac toe interactions.
This lesson introduces JavaScript objects as a key tool in object oriented programming, modeling real world people with properties like name, age, height, hair color, and eye color.
Learn how to create JavaScript objects, assign properties and values, and access them with dot or bracket notation, handle undefined results, and organize multiple objects in an array.
Learn how to create an array of objects in JavaScript, with multiple objects each containing properties, access the second object's color via index and dot notation.
Learn to create a canvas, set its 500x500 dimensions, assign an id, and obtain a 2d drawing context to prepare for drawing shapes in our tic tac toe game.
Draw on the canvas by understanding its 0 0 origin and x y coordinates, move the pen with moveTo, draw with lineTo, and apply color via strokeStyle and stroke.
Learn to draw multiple shapes on a canvas using poly lines and paths, using begin path and close path, then stroke or fill to color outlines or interiors.
Draw circles by using the arc function, supplying the center (x, y), radius, and start and end radians from 0 to 2 pi, with an optional clockwise flag (default false).
Implement a step-by-step javascript algorithm to create a tic tac toe ai: initialize a 3x3 state array, track turns, apply eight winning states, and handle game end.
Describe the step by step algorithm for tic tac toe in JavaScript, validating human moves, tracking empty boxes, and using minimax to choose the best AI move.
Understand how to structure tic tac toe JavaScript by using an anonymous window.onload function to run code after the window loads, initialize state variables, and implement single-line and multi-line comments.
Initialize the tic tac toe game state by defining nine canvases, tracking turns, storing board and symbol arrays, and setting up a minimax game tree for human and AI moves.
Explore declaring and modeling tic tac toe states using arrays and a two-dimensional win-conditions array, converting 1-based indices to zero-based, and preparing winner checks with loops.
Initialize the tic tac toe board: set the food array to false and the symbol array to empty strings for nine cells with a for loop from zero to eight.
Attach a click event to the new game button that triggers a new game function, which reloads the page to restart the tic tac toe game.
Learn to implement a canvas click event in tic tac toe, retrieving the clicked box id via the event object to drive the box click function.
draw the x on the canvas by moving the context to 15,15 and 85,15 for diagonals with a white 21-pixel stroke, then set the symbol to x.
Draw the O in tic tac toe by rendering a circle at the canvas center with radius 35, updating the symbol array, and linking to the AI minimax flow.
Implement a winner check for tic tac toe that analyzes the current symbol array against eight winning lines using a for loop and logical and, returning true or false.
Create the box click function to handle human move, retrieve the clicked box by id, and map canvas ids 1-9 to indices for updating the board and checking win conditions.
Explains the box click function for the human player to play as X, including retrieving the clicked box number, validating moves and game-over status, drawing X, and updating turns.
Implement a box click function to let the human player (X) play tic tac toe, check for a winner or draw, and prepare for ai minimax.
Identify empty boxes in the tic tac toe board to enable the ai to select valid moves using a minimax framework.
Develop the play ai by using minimax to analyze the symbol array and return the AI's next move as an object with the box id for drawing on the canvas.
Learn to implement the ai move logic for tic tac toe using minimax, drawing the next move, updating the board state, and handling game over with a new game option.
Apply the minimax algorithm to evaluate all possible moves in tic tac toe, using a recursive function to build a game tree and pick the optimal move for the AI.
Apply the minimax algorithm to tic tac toe by recursively evaluating terminal states and generating moves with empty boxes function, scoring AI win (+10), human win (-10), or draw (0).
Apply the minimax algorithm to tic tac toe by recursively exploring moves from each state, evaluating terminal states, and alternating between AI and human players to pick the best move.
Apply the minimax algorithm to tic tac toe by enumerating possible moves, recursively evaluating AI versus human states, and updating results to test new board positions.
Explore how the minimax algorithm evaluates tic tac toe game states, distinguishing between terminal and intermediate states, generating legal moves, and using the max function to choose the best move.
Explain how to calculate scores for intermediate tic tac toe states with minimax, distinguishing terminal from non-terminal states and selecting the best move for the AI (max) and human (min).
Explore applying the minimax algorithm to tic tac toe, calculating scores of intermediate states and selecting the optimal AI move across recursive levels.
Explore how a minimax-based AI plays tic tac toe to force draws, showcasing unbeatable performance, while debugging, console checks, and a line-by-line code explanation.
Artificial intelligence is the fastest growing field right now.
This course combines Artificial intelligence and Javascript and takes you into the world of 2D game development and creating 2D AI games.
There are too many job opportunities in this field today, and the scope is huge. Demand for AI programmers is increasing exponentially every day.
Have you always wanted to learn artificial intelligence? Were you not able to do so because you never knew where to start? Is everything confusing out there?
Then our course is the perfect solution to your problem.
In our course,
-> You'll earn the concepts of artificial intelligence,
-> Delve more into theories and implementation by learning what MiniMax algorithm is, and how to implement it,
-> Apply your new found knowledge to create a fully functional Artificial intelligence that can play a Tic Tac Toe game against expert human players.
-> All the while learning, and becoming proficient in Javascript, HTML5 canvas, HTML5, CSS3, front end web development and 2D game development.
Why take this course?
You'll be able to:
1. Learn the basics of artificial intelligence, its terminologies, the various terms used in the field etc.
2. Learn what the MiniMax algorithm is and how it's used in developing Zero sum artificial based games in the real world.
3. Learn how to apply the MiniMax algorithm in a 2D web game like Tic Tac Toe
4. Learn how to create an unbeatable AI opponent in your games
5. Learn the basics of Javascript and HTML5 canvas and how to apply it in your Tic Tac Toe game project
6. Improve your logical problem solving skills
7. Create a complete dynamic Tic Tac Toe game app with an unbeatable AI with Javascript, HTML5 canvas and css
8. Improve your web app development, web game development & javascript skills
9. Improve your front end design and development skills
10. How to design the game logic for the game and implement it as code
11. Learn HTML5, CSS3 and much more while developing your game
12. Add artificial intelligence to your resume with this project as proof of your knowledge
How is this course designed?
I've made this course as easy to understand as possible. I've structured it in such a way that each section will handle one major part of the course.
Introduction: This is where we'll explain how the game works, it's various features and what we'll be using to achieve the same results.
Module 1: We'll explain the basics of artificial intelligence and it's various terminologies. We'll put the ground work you'll need to understand the further concepts explained in this course.
Module 2: We'll explain what the MiniMax alrogithm is and how it's implemented. We'll use pictorical and graphical representation to explain the concept with 2 detailed examples. We'll also explain the Pseudocode of the algorithm.
Module 3: We'll explain how the MiniMax algorithm can be implemented in creating an artificial intelligence based player (computer player) for a Tic Tac Toe game. We'll explain the concept with another pictorical representation of the entire process.
Module 4: We'll delve into Javascript and HTML5 canvas concepts that are related to the project we'll be creating. I'll only cover concepts that we'll need for our game's Javascript code though. If you already know the basics, you can skip this module.
Module 5: We'll be teaching you how to create the bare bones of the app with HTML5. The result will be a page with all the elements we need in our game, devoid any colors or design elements. After that, we'll "beautify" our app. We'll be using CSS elements to give our game colors and styles. At the end of this module, we'll have a Tic Tac Toe web game that'll look like the final result, albeit one that is not playable yet.
Module 6: We'll introduce a step by step algorithm that explains what we'll be doing while creating the Javascript part of our code.
Module 7: We'll be delving into Javascript & HTML5 canvas code of our game in this module, and we'll teach you how to make the game playable (let the user draw on the canvas and display the game results) in here. In this part, we'll create the necessary code to make the human player play the game on the app.
Module 8: This would be the meat of the course. In this module, we'll be applying the MiniMax algorithm with relevant Javascript code to create an artificial intelligence that can play against the human player (the web user).
This course is for you if:
1. If you like learning by doing rather than hours of boring theoretical lectures.
2. If you've always been interested in artificial intelligence, but you're intimidated by the sheer amount of information available on the subject.
3. If you want a simplified way of starting out with artificial intelligence.
4. If you want to pad your resume with an eye-catching skill, a.k.a applied artificial intelligence.
5. If you don't want to just learn theories but start applying it to create an application you can brag about in your resume. You'll be learning the concepts of MiniMax algorithm, a very important algorithm in artificial intelligence, while applying it to create your AI based Tic Tac Toe game. What better way to learn a concept that's considered difficult for most people?
6. If you're a complete newbie to the world of web development, or just programming in general, and would like to start creating software with the help of a beginner-friendly course. You'll learn the basics of everything used in this project (HTM5, CSS3, Javascript, HTML canvas). We'll be explaining every single line of code we'll be using in this course, so you won't feel lost.
7. If you have the passion for programming, and know the basics of HTML5 and CSS, but you're stuck on the practical aspects of it. Turn your theoretical knowledge into practical knowledge with our course.
8. If you want to delve into the exciting world of front end web app development, this course will take you a couple steps further in the right direction.
9. If you're a Javascript web developer who just wants to try out a new project. Our course welcomes coders of every level, from absolute beginners, to pros. By adding artificial intelligence to this project, we've tried to make it interesting for programmers of every level.
10. If you want to learn HTML5 based 2D game development.
So, what are you waiting for? Get this course today, and begin your journey into the wonderful world of Artificial Intelligence and web game development!