Example Code

Example - Textris

Code and Documents

Attachment

Summary:

Textris is a simple game - your goal is to complete a piece of text using the letters you are given. The letters are all placed in a source array, from which you can move them into the game board. The letters from each column in the game board are placed in the column directly above it, so letters can only move up or down, but not left or right.

The game also allows you to get hints if you get stuck.

The idea for the game is not mine (you can find examples online if you search for "drop quotes"), but the name is. The game doesn't actually have anything to do with Tetris, but it has blocks of text which drop down.

I would also suggest checking out the File>>Update Text List option.

I gave the game some polish (mostly in the UI area), but there are still some things it could do better. For instance, failing to update the file list leaves you with a pretty generic error message. Similarly, the list is saved in the program folder, which could be a problem if this was an EXE run by a user with limited access rights.

P.S. The controls don't have tip strips on purpose. They get in the way and are unneeded for controls which are used all the time.

Function:

It's fun. It develops your brain.

Steps to execute code:

  1. Unzip the file.
  2. Open the project.
  3. Open the VI and run it.

Alternatively, you can use the included build spec to build an executable and run that.

Screenshots:

Textris.png

Gameplay demo:

<object id="scPlayer" width="536" height="743" type="application/x-shockwave-flash" data="http://content.screencast.com/users/YairN/folders/Default/media/02e1b8f3-197c-4c87-940f-c2c455fcda14..." >  <param name="movie" value="http://content.screencast.com/users/YairN/folders/Default/media/02e1b8f3-197c-4c87-940f-c2c455fcda14..." />  <param name="quality" value="high" />  <param name="bgcolor" value="#FFFFFF" />  <param name="flashVars" value="thumb=http://content.screencast.com/users/YairN/folders/Default/media/02e1b8f3-197c-4c87-940f-c2c455fcda14..." />  <param name="allowFullScreen" value="true" />  <param name="scale" value="showall" />  <param name="allowScriptAccess" value="always" />  <param name="base" value="http://content.screencast.com/users/YairN/folders/Default/media/02e1b8f3-197c-4c87-940f-c2c455fcda14..." />  Unable to display content. Adobe Flash is required. </object>

VI Snippet:

Irrelevant.

VI attached below (LabVIEW 2009)


___________________
Try to take over the world!

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

Contributors