From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Example Code

Tic Tac Toe

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

Code and Documents

Attachment

Download All

Overview

This example allows you to play Tic-Tac-Toe with a friend or against the computer.

 

Description

This example VI is a variant on an old game. This includes a low level computer intelligence to play against you or you can play with a friend. This is another fun game that was created with LabVIEW and a little imagination. Enjoy!!

 

 

For more information about a TicTacToe LabVIEW code, check out the discussion forum here about the LabVIEW Tic Tac Toe Coding Challenge.

 

Requirements

  • LabVIEW 2012 (or compatible)

 

Steps to Implement or Execute Code

  1. Open and Run Tic Tac Toe Main 2012 NIVerified.vi
  2. Chose Player 1(O) and Player 1(X) by selecting the radio buttons below
  3. Play!
  4. Select the “New Game” button to play again
  5. When finished, select “QUIT"

 

Additional Information or References

 

Block Diagram of Tic Tac Toe Main 2012 NIVerified.vi

1.png

 

2.PNG

 

 

Logic to check diagonal lines to determine the computer's next move.(in Tic Diagonal Lines 2012.vi )

DL.png

 

Logic to check horizontal and vertical lines to determine the computer's next move.(in Tic Horizontal and Vertical Lines 2012.vi )

HV.PNG

 

**This document has been updated to meet the current required format for the NI Code Exchange.**

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Comments
rambo
Member
Member
on

can some one post this code for LabVIEW V6.1 ?? thanks

Ben
Knight of NI Knight of NI
Knight of NI
on

Please see this thread

http://forums.ni.com/ni/board/message?board.id=170&view=by_date_ascending&message.id=181709#M181709

in the NI Forums to find the Tic-Tac_Toe challenge.

Can your code beat "Deep-Toe"?

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
NIquist
Trusted Enthusiast
Trusted Enthusiast
on

Looks like it's missing a "tic1d.vi" SubVI.

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019 - Unfortunately now moving back to C#, .NET, Python due to forced change to subscription model by NI. 8^{
G-Money
NI Employee (retired)
on

I was working on it just as you posted. Thanks for the input!!

G-Money
NI Employee (retired)
on

I unfortunately don't have LabVIEW 6.1 so I can't save it for a previous version. I added some screenshots so maybe you might be able to figure out what I did. You might want to look into a newer version of LabVIEW because NI doesn't support anything before LabVIEW 7.1. Food for thought. Thanks!!

altenbach
Knight of NI Knight of NI
Knight of NI
on

For a full featured 4x4 Tic Tac Toe version, have a look at my entry here. It barely uses any pink or green wires (they are for wimps!), doing everything very efficiently using the bits of integers instead.

https://decibel.ni.com/content/servlet/JiveServlet/downloadImage/102-13914-16-15427/310-182/TicTacToePanel.png