Loops in Neat Script

I recently implemented a bunch of new features in Neat Script and Console. Among these features are expression evaluation and conditions. These features make it possible to create loops in Neat Script files. here’s an example of a loop in Neat Script:

echo off
echo Testing loop
dv l 1
:loop
   echo (l)*(l)=((l)*(l))
   inc l
if ((l)<=10) goto loop
echo Done!
echo on
end

neatloop

So basically this is how you can create loops in Neat Script:

  1. Create a batch file using Notepad or any other text editor
  2. Define labels with a colon before their name (i.e. :label), these will be your loop’s start point
  3. Use goto command to jump to a label
  4. Run your script using call command.

You can control your loops by creating console variables (dvars) and using conditions (if and on commands).

Go ahead and download Neat Game Engine now!

Advertisement

Posted on December 10, 2010, in Game Development / XNA and tagged , , , . Bookmark the permalink. 2 Comments.

  1. Hey. I’m the author of Jemgine (jemgine.codeplex.com), an XNA sidescrolling platformer engine. I’m thinking I might be interested in using your Neat thing as a front end for it, but I wanted to ask you a few questions first. You should be able to see my e-mail since this is your blog; could you drop me a line?

    • Alright!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 40 other followers