? Texty ● SmileBASIC Source

Sign In

Register
*Usernames are case-sensitive
Forgot my password

Texty

Submitted
Updated
Author
kldck_hul
Public Key
B233F3GJ
Min. Compat.
All
Version
1.0
Size
1.5 KB
Rating
4 votes
Description 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 .
Categories
Keywords
  • Text
  • based
  • game
  • command
  • prompt
  • user
  • input
  • string
  • parsing
  • verbs
  • nouns
  • sentences
1 Comment(s) Lacks Lacks I look forward to seeing the more fleshed out example.