Skip to content

Basic Types

mystborn edited this page Feb 28, 2018 · 4 revisions

Basic Types

In TaffyScript, there are very few built in types. The ones that exist are as follows:

  • Number (float)
  • String
  • 1-Dimensional Array
  • 2-Dimensional Array

Numbers

Number constants can be any numerical value with or without a decimal point (i.e. 13354 or 60.6). In addition, you can use the following two hex styles:

  • Prefix with 0x - 0xFFFF00
  • Prefix with ? - ?FFFF00

Strings

String constants can be any character in between single or double qoutes. There is no difference between the two. You can add a newline character by using \n.

Arrays

In order to create an array, just assign a variable to an index like so:

array1[0] = "I'm in an array!";
array2[0, 0] = "I'm in a 2-Dimensional array!";

You can also create a 1D array in the following ways:

  • var arr = array_create(5)
  • `var arr = [0, 1, 2, 3];
Clone this wiki locally