Learn to program Tic Tac Toe Game in Visual C++ on Windows

Build a complete Tic Tac Toe Game as Windows application with Visual studio 2015 / Visual C++ and Windows API
4.5 (166 ratings) Instead of using a simple lifetime average, Udemy calculates a
course's star rating by considering a number of different factors
such as the number of ratings, the age of ratings, and the
likelihood of fraudulent ratings.
7,773 students enrolled
Free
Start Learning Now
  • Lectures 15
  • Length 3 hours
  • Skill Level All Levels
  • Languages English
  • Includes Lifetime access
    30 day money back guarantee!
    Available on iOS and Android
    Certificate of Completion
Wishlisted Wishlist

How taking a course works

Discover

Find online courses made by experts from around the world.

Learn

Take your courses with you and learn anywhere, anytime.

Master

Learn and practice real-world skills and achieve your goals.

About This Course

Published 2/2016 English

Course Description

LEARN HOW TO QUICKLY BUILD A TIC-TAC-TOE GAME ON WINDOWS USING VISUAL C++

Do you want to learn how to build Windows applications using C++ and Windows API? Do you want to build a native Windows application in C++ and have it run on any version of Windows including Windows 7, Windows 8, Windows 8.1 and Windows 10?

Do you want to learn some cool techniques for handling arrays in C/C++? Are you curious to learn what it takes to build a game with Visual C++ on Windows?

If you say yes to any of these questions, then you should consider taking this course today!

WHAT YOU ARE GOING TO LEARN:

  • The basic concepts, tools and functions you need to build a complete Tic Tac Toe game with Visual C++ on Windows
  • The building blocks of a Windows GUI application including Windows, Menus, Texts, Shapes and Icons
  • How to prompt the user for messages and how to use MessageBox API
  • What is GDI and how to use it to draw texts, shapes and icons
  • How to handle Windows messages and how to center elements inside your window
  • And more tips and tricks of the trade!

This course is 100% free, so there is nothing to lose! I made my best efforts to provide high quality content and to make this both useful and fun to watch.

Let’s get started today! Enroll now!

WHAT'S IN THE COURSE?

  • Over 15 lectures and 3 hours of video content
  • Code Tic-Tac-Toe in C/C++ on Windows
  • Understand how to write efficient C++ for Windows
  • Learn how Windows applications work
  • Understand how painting works on Windows and how to utilize it for your apps
  • Build a complete tic-tac-toe game by following this course
  • Learn how to add menus, messages and how to draw inside your application with GDI

COURSE REQUIREMENTS:

  • Basic knowledge of C/C++ like loops, functions, variables and if conditions
  • Basic understanding of pointers and structs in C/C++
  • Windows 7 or newer
  • Visual Studio installation – Visual Studio 2015 Community Edition (Recommended)
  • Developers who want to learn how to program on Windows with C++
  • Anyone who wants to learn how to use Visual C++ and Windows API

NOTES

 In this course I try to cover basic understanding of Windows programming as well as the functions we use. However, it requires a lot of time and effort to cover Windows programming and Windows APIs from scratch, which is outside the scope of this course.

OVER 400 STUDENTS ON FIRST DAY & OVER 1 THOUSAND STUDENTS THE FIRST WEEK!

ENROLL TODAY TO LEARN HOW TO BUILD YOUR OWN TIC-TAC-TOE!

NOTE: FULL SOURCE CODE ATTACHED TO LECTURE #15

What are the requirements?

  • Installation of Visual Studio 2015 Community Edition (Free)
  • Understanding of Windows environment and applications
  • Basic knowledge of C/C++ like writing functions, if conditions and loops
  • Familiarity with C/C++ structures and pointers

What am I going to get from this course?

  • Learn the basic concepts, tools and functions you need to build a complete Tic Tac Toe game with Visual C++ on Windows
  • Build a fully functional Tic Tac To Game as a Windows Application
  • Create Native Windows Applications with Menus, Messages, Text and Icons

What is the target audience?

  • This course is a quick overview and an introduction to anyone interested in learning building Windows Applications and Programming Windows API using C/C++
  • You must have some basic knowledge of Programming in C/C++ to be able to understand the concepts mentioned here

What you get with this course?

Not for you? No problem.
30 day money back guarantee.

Forever yours.
Lifetime access.

Learn on the go.
Desktop, iOS and Android.

Get rewarded.
Certificate of completion.

Curriculum

Section 1: Learn to program Tic Tac Toe in Visual C++ on Windows
04:19

In this video we will take a quick look at the application we're going to build together during this tutorial!

I hope you enjoy it and find it useful!

12:58

In this video I will walk you through the process to create a new Windows application using Visual Studio 2015 and briefly go over the generated code together to understand the components of the Win32 applications that we will use for our Tic Tac Toe game.

Please make sure to download and install Visual Studio Community Edition (Free) from Microsoft.

12:25

In this video we discuss some Windows API to draw the rectangle for our Tic Tac Toe game board. We also learn how to make it always centered and also learn how to prevent the user from re-sizing the window smaller than the size of the game board itself.

15:15

In this lecture, we learn how to change background color of our application window and also learn different ways to slice and dice our game board into individual cells.


17:17

In this lecture, we learn how to detect mouse clicks by handling WM_LBUTTONDOWN message and then we learn how to write a function together in C/C++ to determine the rectangular area of the cell clicked by the user

14:39

In this lecture we learn how to implement GetCellRect function to calculate the dimensions of a given cell at index location (0 to 8) and return that as a RECT structure

08:15

In this part, we continue to explore how to use solid brushes for players. We will create a red brush and a blue brush and see how we can alternate between the two using some code logic.


13:44

In this lecture, we learn how to best store player moves in memory using 1-dimensional array (vector) so that we track player moves and also to redraw everything whenever we receive a WM_PAINT message

19:15

In this lecture we learn how to implement GetWinner function and learn how to display messages to the players using MessageBox and also we will learn how to efficiently manipulate arrays and avoid writing too many if conditional statements

09:36

In this lecture, we learn how to modify resource files to add menu items. We will also learn how to prompt user for YES/NO and how to reset the game and start a new game

08:27

In this lecture, we learn how to draw out some text inside the main window using GDI and also learn about setting text foreground and background colors

14:10

In this part, we see how to implement a function called ShowTurn that helps us show turn messages as well as other messages in the main window as the players take turns

14:53

In this lecture, we learn how to draw images using icons instead of the red & blue colors.

11:10

In this part we continue to make further enhancements to the code and also learn how to highlight the three cells that contain the winning move using colors

03:14

In this lecture, I close the course with some final ideas on how to improve this further and expand on it and also I would like to hear feedback and comments for better courses and projects in the near future...

Also, please find the source code attached to this lecture and thanks for watching!

Students Who Viewed This Course Also Viewed

  • Loading
  • Loading
  • Loading

Instructor Biography

Moe Mohammad El-Haj, Senior Software Design Engineer / Manager / Consultant

Hi there!

My name is Mohammad and I have a degree in computer sciences and have been working as a professional software engineer since 1995. I wrote my first program in GW-BASIC when I was 14 years old and since then I knew that I wanna grow up to become a programmer as it is the love and passion of my life.

I also started teaching Visual C/C++ and Visual basic back in 1997 and that is when I learned how much I enjoy teaching and helping others.

I live in Seattle where I moved to the states back in 1999 to work for Microsoft and learned so many tips and tricks of the trade during my 9 years at Microsoft as a senior software engineer.

Over 20 years of my career, I worked with many companies from startups to medium size companies like Citrix and to big companies like Microsoft. During that time, I learned so many languages and technologies from Visual Basic, C/C++, Win32, ATL, COM, Python, Java, Javascript, C# and .NET and many more. I built Windows applications, mobile applications, built some websites and built games using Unity and many other tools. I like to share my experience and help others become professional developers as well.

I mentored, lead and managed many developers in my career and successfully helped ship many products including V 1.0 products like Microsoft Office Communicator ( aka Lync or Skype for Business). When I found out about Udemy, I was immediately hooked as a student, but I also wanted to pursue my passion as an instructor as I know that I enjoy teaching and helping others and I think I can make the learning experience fun and easy :)

Looking forward to getting to e-meet and know everyone on Udemy!

Yours,

-Mohammad.

Ready to start learning?
Start Learning Now