LoginLogin
Nintendo shutting down 3DS + Wii U online services, see our post

Texty

Root / Submissions / [.]

kldck_hulCreated:
Download:B233F3GJ
Version:1.0Size:1.5 KB
Texty is a simple wrapper around Actorbug's REGEX library It enables programmers to write complex commands for text-based games. That's it!

Instructions:

Texty has 5 functions: TextyCmd(C$) - Parse a string with texty and run an associated command if found. Returns true if it matched a command, otherwise returns false. TextyAdd CMD$, CMD_FUNC$ - Add a command to texty. CMD$ is a regex string. CMD_FUNC$ must be a command that takes a string array
  TextyAdd "({MOVE}) to ({NOUN})", "moveTo"
  DEF moveTo T$[]
    ... T$[0] is your move command ...
    ... T$[1] is the noun ...
  END
  
TextyTmpl(S$) - Interpolate a string using global variable names. Must be strings. $ will be implied if not specified.
TextyTmpl("You can use {globalVariable} names!")
TextyUpper$(S$) & TextyLower$(S$) - Convert a string to lower or uppercase. Copied from DEFY .

I look forward to seeing the more fleshed out example.