SSTNPL Guide

Overview:

SBTCVM Simplified Ternary Numeric Programming Language, or SSTNPL for short, is SBTCVM's 2nd oldest language. It actually shares much of its compiler design and structuring with SBTCVM assembly v3, the latest revision of SBTCVM's oldest language.


Its main feature is its named integer variables, which let you treat each number like an object of sorts, rather than fussing with registers and memory locations in assembly. As well, its extensive character, input, and printing support allows formatting algorithm output, and even devising games, such as:
  • Ternary Maze Engine 'maze' a 1-level demo showcasing a fully-operational maze engine running in SBTCVM gen 2
  • Guess That Trit 'gtt' SBTCVM's classic number guessing game, returns in SSTNPL form.
  • Difference Cards 'diffcards' a 2-player card-drawing game.  
  • Highway 'highway' A 1 or 2 player highway-themed guessing game.
  • Oncoming Trains 'ontrain': SBTCVM's first graphical game, the plotter-based oncoming trains is a 2-track dodge type game.

A basic overview of features:

  • named integers For all your character and integer needs
  • Integer operations for a variety of needs.
  • static 2-axis tables with rewritable cells
  • label-based gotos
  • Stacked Subroutine system with conditional subroutine calls and conditional returns.
  • iterators for running subroutines multiple times with a linear range of numbers.
  • Exstensive TTY input and output, Including a keyprompt macro for easier menus, value printing, and formatting macros.
  • Loadable modules Precompiled modules can be loaded into your code, and you can even compile your own via the compiler's --module option.
  • Indentation support Allows you to indent your code as you please.

Compiling and running:

Step-by-step:
  1. in vmuser create a folder with your desired project name.
  2. place your SSTNPL code in a file starting with 'auto_' and ending with a '.stnp' extension, ensuring its in the project folder you created. 
  3. read SSTNPL's documentation in the textdocs/SSTNPL directory.
  4. program your SSTNPL code.
  5. Run 'stnpcom.py' in a terminal with the name of your project folder ONLY. you DO NOT need to specify the path. 
  6. if the compiler reported an error, return to step 3.
  7. if the compiler was successful, run 'pyg_sbtcvm.py' in a terminl, with your folder name as an argument. a window should appear.

Tips:

  • read the documentation in textdocs/SSTNPL
  • If you followed the step-by-step and used a project folder, you can create a neat little repository using it.
  • Be sure to use Literals. they can be very handy. (not to mention leave less 'var' statements about.
  • Speaking of 'var' statements, id recommend placing them at the top of your program, and perhaps use comments to label them.
  • SSTNPL code can get messy fast. comments & indentation are your friends. ☺
  • You can embed assembly using the 'asm' keyword. USE WITH CAUTION
  • try to limit your embedded assembly register manipulation to Register 1 and Register 2. and keep clear of stacks, interrupts, and memory pointers and the like.
  • And most importantly, READ THE DOCUMENTATION IN textdocs/SSTNPL
  • and did i mention, read the documentation? ☺


No comments:

Post a Comment