# Documentation Documentation for FlowJS. ## Types FlowJS mostly uses TypeScript-style types, except for `int` and `float` for feature parity with Flowgorithm. Note that these names are slightly different from Flowgorithm's, `int` translates to `Integer`, `float` translates to `Real`, and the rest have similar capitalization. ## Builtins ### `print(x: any)` Translates to an `Output` statement. ### `input(var: )` Translates to an `Input` statement. `var` must be a variable identifier. ### `attr(key: string, value: string)` Applies a value to a specific program attribute. Available attributes: - **name** - the program's name - **authors** - the program's authors - **about** - description of the program - **saved** - a date string in the form of `yyyy-MM-dd HH:mm:ss a` e.g. `2022-10-23 11:10:23 AM` (keep in mind the 12-hour time format) **edited** and **created** are also available but are always overwritten upon transpilation. ### `meta(key: string, value: string)` Applies a value to a specific meta property of a program. Available keys: - **username** - your logged in user - **hostname** - your computer's hostname - **editVersion** - the program's edit version (starts from 1) - **editMysteryNumber** - idk what this even is but it starts at like 2300 iirc ### `comment(comment: string)` Creates a comment with the given string. ### `insist(var: )` **(temporary)** ยท A lazy temporary soution to make the typechecker believe that an identifier has been **defined** without affecting the output code. ## Statements ### `for` For statement syntax is slightly different from JS/TS syntax in order to have compatibility with Flowgorithm's. `for (init; ; upd) ` - `init` can either be ` = ` with an optional `let`. `` should always be an `` and `` should always be a ``. - `` is the number to end the loop at. It should always be a ``. - `upd` can either be (where `` matches that of `init`): - `++/--` - This assumes step is 1 and direction is either "inc" (`++`) or "dec" (`--`). - ` +=/-= ` - Here you can define the step number, and direction is either "inc" (`+=`) or "dec" (`-=`). #### Examples: ```ts for (let i = 0; 10; i++) { print("Going up! " + i); } ``` ```ts // `i` was declared earlier for (i = 20; 10; i -= 2) { print("Going down! " + i ) } ```