Example Code

2048 Game Using LabVIEW

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 is a LabVIEW version of the number game 2048.


Description
A LabVIEW implementation of the game 2048 (http://en.wikipedia.org/wiki/2048_(video_game)). Use the left, right, up, and down arrows to slide number tiles along a grid. A new tile appears each time you slide. Tiles containing the same number add together to make larger values. Create a tile with the value 2048 to win.

Mac keyboards produce different keycodes for arrows, so, not working in mac.

 


Requirements

  • LabVIEW 2012 (or compatible)


Steps to Implement or Execute Code

  1. Run the 2048.vi
  2. Use the the left, right, up, and down arrows to slide number

 

Additional Information or References

Front Panel of 2048.vi

 FP.png

VI Block Diagram of 2048.vi

 BD.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
gustavoa
Member
Member
on

Mac keyboards produce different keycodes for arrows, so, not working in mac.