<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Thomas Leathers</title>
    <description>The latest articles on Forem by Thomas Leathers (@thomasthespacefox).</description>
    <link>https://forem.com/thomasthespacefox</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F30106%2F06b4786e-56f4-4bea-b217-757282c64af3.jpg</url>
      <title>Forem: Thomas Leathers</title>
      <link>https://forem.com/thomasthespacefox</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/thomasthespacefox"/>
    <language>en</language>
    <item>
      <title>Constants &amp; Variables: SSTNPL's new Integer Constants</title>
      <dc:creator>Thomas Leathers</dc:creator>
      <pubDate>Thu, 16 Apr 2020 20:35:46 +0000</pubDate>
      <link>https://forem.com/thomasthespacefox/constants-variables-sstnpl-s-new-integer-constants-247j</link>
      <guid>https://forem.com/thomasthespacefox/constants-variables-sstnpl-s-new-integer-constants-247j</guid>
      <description>&lt;h1&gt;
  
  
  Part 1: SSTNPL Integer background
&lt;/h1&gt;

&lt;p&gt;SSTNPL &lt;em&gt;(A Programming Language for my Balanced Ternary VM: SBTCVM)&lt;/em&gt;, f has always had integer variables, as they were part of its original design. creating &amp;amp; using integer variables in SSTNPL is easy enough:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#create 3 variables using: decimal, ternary, &amp;amp; a character value.
var bob=@11
var bob2=*+0-
var bob3=:L
#dump the decimal values of each variable to SBTCVM's Terminal
dumpd bob
dumpd bob2
dumpd bob3
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h1&gt;
  
  
  Part 2: The Integer Literal Syntax
&lt;/h1&gt;

&lt;p&gt;However, we can also just use SSTNPL's 'literal' syntax, that's supported on most integer input arguments:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#same as above, just using the 'literal' syntax
dumpd @11
dumpd *+0-
dumpd :L
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h1&gt;
  
  
  Part 3: The builtin constants
&lt;/h1&gt;

&lt;p&gt;Whats changed in SSTNPL, is the introduction of a special, forth 'literal' syntax: the constant. Currently, SSTNPL has 2 of them builtin:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#$true=1, $false=0
dumpd $true
dumpd $false
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h1&gt;
  
  
  Part 4: Use a custom constant to store a module's version number.
&lt;/h1&gt;

&lt;p&gt;while there are still some holes &lt;em&gt;(you can't use constants in var &amp;amp; val statements yet for example)&lt;/em&gt;, We can use constants to provide static values that when not used, don't use up Memory:&lt;/p&gt;

&lt;p&gt;for example, in an SSTNPL module called 'bob':&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const version=@15
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;That way we could write an SSTNPL program like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#print version of bob module
prline Bob version:
dumpd $b.version

#wait for keystroke, then power-off the VM
keyprompt
stop

include bob as b
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;While SSTNPL &amp;amp; SBTCVM are still &lt;em&gt;technically&lt;/em&gt; in alpha, and aren't that useful for practical purposes, I've put a lot of work into both, &amp;amp; hope others find programming a Balanced Ternary VM as interesting as I do.&lt;/p&gt;

&lt;p&gt;SBTCVM Gen2-9 On github: &lt;a href="https://github.com/SBTCVM/SBTCVM-Gen2-9"&gt;https://github.com/SBTCVM/SBTCVM-Gen2-9&lt;/a&gt;&lt;br&gt;
SSTNPL Language docs: &lt;a href="https://github.com/SBTCVM/SBTCVM-Gen2-9/tree/master/textdocs/SSTNPL"&gt;https://github.com/SBTCVM/SBTCVM-Gen2-9/tree/master/textdocs/SSTNPL&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ternary</category>
      <category>sstnpl</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>SSTNPL v0.3: Modules &amp; command prompts.</title>
      <dc:creator>Thomas Leathers</dc:creator>
      <pubDate>Wed, 20 Feb 2019 05:35:23 +0000</pubDate>
      <link>https://forem.com/thomasthespacefox/sstnpl-v03-modules--command-prompts-5g4m</link>
      <guid>https://forem.com/thomasthespacefox/sstnpl-v03-modules--command-prompts-5g4m</guid>
      <description>&lt;h1&gt;
  
  
  Overview:
&lt;/h1&gt;

&lt;p&gt;Some of you may have seen my tutorials on SSTNPL in the past, but considering how much has been added since then, i figure id post about some of its latest features.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/SBTCVM/SBTCVM-Gen2-9/blob/master/demos/shelldemo/auto_main.stnp"&gt;This post will refrence this SSTNPL source file&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  simple, yet endlessly helpful.
&lt;/h3&gt;

&lt;p&gt;One of the first things you might notice if you scroll down past the comments, is the code indenting. similar to languages like C, it means nothing, but is there to help make code more readable.&lt;/p&gt;

&lt;h3&gt;
  
  
  command prompts ahoy!
&lt;/h3&gt;

&lt;p&gt;The linked SSTNPL soruce code actually creates basic Command line shell. now, part of this involves the new module system, and a module called comprompt. but all the latter does is take user input and pass it into an SSTNPL table (2D array, note that SSTNPL has no normal 1D arrays).&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gsub cp.getentry
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The actual syntax checking is done via the tabstrc operations &lt;a href="https://github.com/SBTCVM/SBTCVM-Gen2-9/blob/master/demos/shelldemo/auto_main.stnp#L57"&gt;that start at line 57&lt;/a&gt;. all it does is checks if the given string is at the given location, in the given table. notice the table name starts with &lt;code&gt;cp.&lt;/code&gt;.&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;tabstrc cp.buffer,@0,@0,help
    set cmdflg
    if cmdflg,@1 =validcom @1
    if cmdflg,@1 gsub help
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h3&gt;
  
  
  module system.
&lt;/h3&gt;

&lt;p&gt;if you scroll to the end of the file, you will see a command that looks like such:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;include comprompt as cp

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



</description>
      <category>sstnpl</category>
      <category>showdev</category>
      <category>sbtcvm</category>
    </item>
    <item>
      <title>Have you ever designed your own language?</title>
      <dc:creator>Thomas Leathers</dc:creator>
      <pubDate>Sun, 27 Jan 2019 02:44:10 +0000</pubDate>
      <link>https://forem.com/thomasthespacefox/have-you-ever-designed-your-own-language-2pf6</link>
      <guid>https://forem.com/thomasthespacefox/have-you-ever-designed-your-own-language-2pf6</guid>
      <description>

</description>
      <category>discuss</category>
      <category>languages</category>
      <category>compilers</category>
    </item>
    <item>
      <title>Rainbow effect: ternary color spaces and SBTCVM</title>
      <dc:creator>Thomas Leathers</dc:creator>
      <pubDate>Sat, 17 Nov 2018 06:03:43 +0000</pubDate>
      <link>https://forem.com/thomasthespacefox/rainbow-effect-ternary-color-spaces-and-sbtcvm-2bp4</link>
      <guid>https://forem.com/thomasthespacefox/rainbow-effect-ternary-color-spaces-and-sbtcvm-2bp4</guid>
      <description>&lt;h2&gt;
  
  
  SBTCVM's pygame frontend and its many colors.
&lt;/h2&gt;

&lt;p&gt;The pygame frontend. It was the oldest interface SBTCVM had aside from a barren terminal, without even a period of curses to be seen. Now, after much work on the common components of SBTCVM gen2-9, pygame makes a return to SBTCVM, with a new frontend. A few new features have made it into SBTCVM via the pygame frontend as well.&lt;/p&gt;

&lt;p&gt;SBTCVM, traditionally, had only plain, black &amp;amp; white text coloring. However, it has had graphics of one sort or another for a while, so color is no new addition to it.&lt;/p&gt;

&lt;p&gt;With the many changes in SBTCVM's newest revision, comes colored text functionality. While the feature itself is new, it, in-part, uses some research that began before SBTCVM even did.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;colortext&lt;/strong&gt; demo. Shows off 27-color foreground and background colors.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--zrpLFUNu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/7maff79go84nfurgoy6r.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--zrpLFUNu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/7maff79go84nfurgoy6r.png" alt="Screenshot showing colored text."&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Years ago, before SBTCVM was even a thing, I was working with balanced ternary color palettes, and possible graphics resolutions, and so forth. namely:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;1-trit Greyscale (3 shades)&lt;/li&gt;
&lt;li&gt;2-trit Greyscale (9 shades)&lt;/li&gt;
&lt;li&gt;3-trit Greyscale (27 shades)&lt;/li&gt;
&lt;li&gt;3-trit RGB (27 colors)&lt;/li&gt;
&lt;li&gt;6-trit RGB (729 colors) [later on]&lt;/li&gt;
&lt;li&gt;9-trit RGB (19683 colors) [later on]&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These 3 Balanced Ternary color spaces were interesting to work with ascetically, and are the reason even SBTCVM's predecessor, TDA-Mark1, had color support, in the form of a crude 729-color, 27x27 pixel &lt;code&gt;vector plotter&lt;/code&gt;, and a smaller monochromatic, 9x9 &lt;code&gt;vector plotter&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;While those plotters no longer exist in SBTCVM Gen 2-9, a new 243x243, 19683 color (9-trit RGB), vector plotter has appeared, in the form of SBTGA mode 30.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;colorpack&lt;/strong&gt; demo. Shows off a 3-trit RGB color-block encoding scheme.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--6j2Gz3_A--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/7mwbkk6qch1ntua9mpz3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--6j2Gz3_A--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/7mwbkk6qch1ntua9mpz3.png" alt="screenshot showing 27-color packed art encoding"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The new pygame frontend's TTY has both a 3-color indexed and a 27-color RGB color-block encoding scheme. (mainly to save memory, and ease coding.)&lt;/p&gt;

&lt;h1&gt;
  
  
  Some observations on ternary colors
&lt;/h1&gt;

&lt;p&gt;While SBTCVM may have had colors for a while, as far as I've seen, its the only balanced ternary computer, virtual or not, to really tackle the problem. One odd thing is 0 is never black in linear RGB and monochrome palettes. the lowest negative value is. while the highest positive value is always white.&lt;/p&gt;

&lt;p&gt;Compared to binary, balanced ternary color palettes balloon in size quite quickly:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;No. of Units&lt;/th&gt;
&lt;th&gt;ternary colors&lt;/th&gt;
&lt;th&gt;binary colors&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;9&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;27&lt;/td&gt;
&lt;td&gt;8&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;81&lt;/td&gt;
&lt;td&gt;16&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;td&gt;729&lt;/td&gt;
&lt;td&gt;64&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;8&lt;/td&gt;
&lt;td&gt;6561&lt;/td&gt;
&lt;td&gt;256&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;9&lt;/td&gt;
&lt;td&gt;19683&lt;/td&gt;
&lt;td&gt;512&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Units, refers to the equivalent bits/trits measurements of binary &amp;amp; balanced ternary respectively.&lt;/p&gt;

&lt;p&gt;Overall, I've learned quite a few things about balanced ternary since starting SBTCVM, and even learned some things before that. As well, all this new color text and graphics should make SBTCVM a bit more interesting at least.&lt;/p&gt;

&lt;p&gt;To use the new pygame frontend, just run:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;./pyg_sbtcvm.py&lt;/code&gt;&lt;/p&gt;

</description>
      <category>showdev</category>
      <category>sbtcvm</category>
      <category>colors</category>
      <category>ternary</category>
    </item>
    <item>
      <title>SBTCVM's SSTNPL, Part 3: iterators</title>
      <dc:creator>Thomas Leathers</dc:creator>
      <pubDate>Mon, 22 Oct 2018 19:07:23 +0000</pubDate>
      <link>https://forem.com/thomasthespacefox/sbtcvms-sstnpl-part-3-iterators-3gjp</link>
      <guid>https://forem.com/thomasthespacefox/sbtcvms-sstnpl-part-3-iterators-3gjp</guid>
      <description>&lt;p&gt;Welcome back to part 3 of my tutorial series on SSTNPL, a programming language for the 9-trit balanced ternary Virtual machine known as SBTCVM. In &lt;a href="https://dev.to/thomasthespacefox/sbtcvms-sstnpl-part-1-basics-3a7h"&gt;part 1&lt;/a&gt;, we discussed basic menus and did some basic variable setting. While in &lt;a href="https://dev.to/thomasthespacefox/sbtcvms-sstnpl-part-2-cards-on-the-table-f83"&gt;part 2&lt;/a&gt; we looked at SSTNPL's 2D, array-like table system.&lt;/p&gt;

&lt;p&gt;In this part, we will take a look at SSTNPL's iterators and how to use them to iterate over tables.&lt;/p&gt;

&lt;h1&gt;
  
  
  Getting Started
&lt;/h1&gt;

&lt;p&gt;like before, copy the tutorial_example_3.stnp file into your VMUSER directory located where you installed SBTCVM.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;h1&gt;
  
  
  basic iterators
&lt;/h1&gt;

&lt;p&gt;the basic iterators come in 2 variants, each with 4 arguments:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;itval:&lt;/strong&gt; a variable name to be newly created. use this to get iterator 'state'&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;sub:&lt;/strong&gt; a subroutine label. You need to put the code you want to iterate with in a subroutine, and specify it here.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;start:&lt;/strong&gt; The starting value of the iteration. Can be variable or literal &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;end:&lt;/strong&gt; The ending value of the iteration. Can be variable or literal
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;uiter itval,sub,start,end
diter itval,sub,start,end
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;So what does &lt;code&gt;uiter&lt;/code&gt; and &lt;code&gt;diter&lt;/code&gt; do? Well, &lt;code&gt;uiter&lt;/code&gt; iterates &lt;strong&gt;U&lt;/strong&gt;p from &lt;code&gt;start&lt;/code&gt; to &lt;code&gt;end&lt;/code&gt;, while &lt;code&gt;diter&lt;/code&gt; iterates &lt;strong&gt;D&lt;/strong&gt;own from &lt;code&gt;start&lt;/code&gt; to &lt;code&gt;end&lt;/code&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  double iterators
&lt;/h1&gt;

&lt;p&gt;Double iterators, are just that, 2 iterators in 1. For the sake of this tutorial, we'll call them the X iterator and the Y iterator. Whats the point of double iterators? Well, you will see later in this tutorial.&lt;br&gt;
the double iterators also come in 2 variants, however, they have 7 arguments:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;u2iter itvalx,itvaly,sub,startx,endx,starty,endy
d2iter itvalx,itvaly,sub,startx,endx,starty,endy
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;itvalx:&lt;/strong&gt; a variable name to be newly created. Use this to get the X iterator state.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;itvaly:&lt;/strong&gt; a variable name to be newly created. Use this to get the Y iterator state.&lt;/li&gt;
&lt;li&gt;sub: a subroutine label. You need to put the code you want to iterate with in a subroutine, and specify it here.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;startx:&lt;/strong&gt; starting value of the X iterator. Can be variable or literal &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;starty:&lt;/strong&gt; starting value of the Y iterator. Can be variable or literal &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;endx:&lt;/strong&gt; ending value of the X iterator. Can be variable or literal &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;endy:&lt;/strong&gt; ending value of the Y iterator. Can be variable or literal &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;u2iter&lt;/strong&gt; counts from &lt;code&gt;startx&lt;/code&gt; UP TO &lt;code&gt;endx&lt;/code&gt; for each number of &lt;code&gt;starty&lt;/code&gt; UP TO &lt;code&gt;endy&lt;/code&gt;&lt;br&gt;
and needs both ENDs to be GREATER than their respective STARTs&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;d2iter&lt;/strong&gt; counts from &lt;code&gt;startx&lt;/code&gt; DOWN TO &lt;code&gt;endx&lt;/code&gt; for each number of &lt;code&gt;starty&lt;/code&gt; DOWN TO &lt;code&gt;endy&lt;/code&gt; and needs both ENDs to be LESS than their respective STARTs&lt;/p&gt;

&lt;p&gt;Basically u2iter and d2iter run the X iterator for each iteration of the Y iterator.&lt;/p&gt;
&lt;h1&gt;
  
  
  iterating over rows
&lt;/h1&gt;

&lt;p&gt;Now that we know how to use SSTNPL's iterators in general, lets look how they apply to tables. For starters, lets iterate over the first row of our table 'sam'.&lt;/p&gt;

&lt;p&gt;All we really need to do, is iterate over the X position argument of &lt;code&gt;tabr&lt;/code&gt;, while having the y position argument pointing to the desired row.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;uiter itval,getat1,@0,@2

label getat1
tabr sam,itval,@0
set cb
chardump cb
return
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;remember: table X and Y indexes start at 0, so our iterator range is 0-2&lt;/p&gt;

&lt;h1&gt;
  
  
  iterating over columns
&lt;/h1&gt;

&lt;p&gt;Exactly the same as rows, but we iterate over the Y position argument of &lt;code&gt;tabr&lt;/code&gt; while the X position argument points to the desired column.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;uiter itval,getat1B,@0,@2
#
label getat1B
tabr sam,@0,itval
set cb
chardump cb
return
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h1&gt;
  
  
  iterating over the whole thing
&lt;/h1&gt;

&lt;p&gt;You see where this is going, don't you? Yes, all we need to do to iterate over the whole table is iterate over both the X and Y position arguments of &lt;code&gt;tabr&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;u2iter itvalx,itvaly,getat2,@0,@2,@0,@2
#
label getat2
tabr sam,itvalx,itvaly
set cb
chardump cb
return
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Simple eh? oh, and if you want to iterate over arbitrary sections of the table, say just columns 2 and 3:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;u2iter itvalx,itvaly,getat2,@1,@2,@0,@2
#
label getat2
tabr sam,itvalx,itvaly
set cb
chardump cb
return
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Now do you see the point of the double iterators? i sure hope so.&lt;/p&gt;

&lt;h1&gt;
  
  
  Compiling &amp;amp; running
&lt;/h1&gt;

&lt;p&gt;just as in part 1:&lt;/p&gt;

&lt;p&gt;compile: ./stnpcom.py tutorial_example_3&lt;/p&gt;

&lt;p&gt;run: /SBTCVM_G2_9.py tutorial_example_3&lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;Well, i hope you found these 3 tutorials helpful and informative. Just don't be surprised to see more SSTNPL tutorials in the future, as SSTNPL gains more features.&lt;/p&gt;

</description>
      <category>sbtcvm</category>
      <category>ternary</category>
      <category>sstnpl</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Whats the most obscure open source project you've worked on?</title>
      <dc:creator>Thomas Leathers</dc:creator>
      <pubDate>Fri, 19 Oct 2018 23:57:45 +0000</pubDate>
      <link>https://forem.com/thomasthespacefox/whats-the-most-obscure-open-source-project-youve-worked-on-615</link>
      <guid>https://forem.com/thomasthespacefox/whats-the-most-obscure-open-source-project-youve-worked-on-615</guid>
      <description>

</description>
      <category>discuss</category>
      <category>opensource</category>
    </item>
    <item>
      <title>SBTCVM's SSTNPL Part 2: cards on the table</title>
      <dc:creator>Thomas Leathers</dc:creator>
      <pubDate>Fri, 19 Oct 2018 01:34:46 +0000</pubDate>
      <link>https://forem.com/thomasthespacefox/sbtcvms-sstnpl-part-2-cards-on-the-table-f83</link>
      <guid>https://forem.com/thomasthespacefox/sbtcvms-sstnpl-part-2-cards-on-the-table-f83</guid>
      <description>&lt;p&gt;Welcome back to part 2 of my tutorial series on SSTNPL, a programming language for the 9-trit balanced ternary Virtual machine known as SBTCVM. In &lt;a href="https://dev.to/thomasthespacefox/sbtcvms-sstnpl-part-1-basics-3a7h"&gt;part 1&lt;/a&gt;, we discussed basic menus and did some basic variable setting.&lt;/p&gt;

&lt;p&gt;In this part, we will take a look at how to work with SSTNPL's tables, and look at how they can be quite useful.&lt;/p&gt;

&lt;h1&gt;
  
  
  Getting started
&lt;/h1&gt;

&lt;p&gt;like before, copy the tutorial_example_2.stnp file into your VMUSER directory located where you installed SBTCVM.&lt;/p&gt;

&lt;p&gt;Now, you may be asking, whats a table in SSTNPL? to put it simply a table is a 2D array of 'cells' that can be accessed via x and y coordinates.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;h1&gt;
  
  
  the 3 table types:
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;self-printing single-cell&lt;/strong&gt; (name in example: &lt;strong&gt;sam&lt;/strong&gt;, labeled: 'prline-based')&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;basic single-cell&lt;/strong&gt; (name in example: &lt;strong&gt;sam2&lt;/strong&gt;, labeled: 'tstr-based')&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;double-cell&lt;/strong&gt; (name in example: &lt;strong&gt;bob&lt;/strong&gt;, labeled: 'Double-cell table')&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;you will see at the top, both single-cell types are within subroutines, but only the self-printing table actually prints itself, while the other doesn't do much of anything. &lt;/p&gt;

&lt;p&gt;table structure:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;table name,[width],[height]
tstr abcx
tdat @1;@2;@3;@4
prline ABC
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Note that self-printing tables need to be specified as 1 column wider than they appear, due to &lt;code&gt;prline&lt;/code&gt; always appending a newline. (That's why they print correctly formatted.) (notice that &lt;code&gt;prline&lt;/code&gt; has 3 characters visible, while &lt;code&gt;tstr&lt;/code&gt; and &lt;code&gt;tdat&lt;/code&gt; have 4 values shown.)&lt;/p&gt;

&lt;p&gt;All three of these are technically the same type, and aside from the double-cell tables having an extra value in each cell, there's not much difference.&lt;/p&gt;

&lt;h1&gt;
  
  
  Reading and writing tables:
&lt;/h1&gt;

&lt;p&gt;looking at the section commented with the same name, we see tabr, tabw and tabcd all referencing our self-printing single-cell table 'sam', and making liberal use of decimal and character literals, of which part 1 discusses in more detail.&lt;/p&gt;

&lt;p&gt;tabr, tabdd, and tabcd's arguments:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;tabr table,x,y
tabcd table,x,y
tabdd table,x,y
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;looking at the code, we see 0,0 is our x,y location, and that the coordinates start at 0,0. &lt;code&gt;tabr&lt;/code&gt; is a basic read operation, while &lt;code&gt;tabdd&lt;/code&gt; and &lt;code&gt;tabcd&lt;/code&gt; print the read value as decimal or a character respectively, but still provide the value to our old friend &lt;code&gt;set&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;tabw's arguments are similar:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;tabw table,x,y,value
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;the only difference is &lt;code&gt;value&lt;/code&gt;, yet another variable, that contains the value we wish to write to the given table coordinates. or we could just throw a literal at it and call it a day.&lt;/p&gt;

&lt;h1&gt;
  
  
  working with double-cell tables:
&lt;/h1&gt;

&lt;p&gt;As we delve into our third and final table type, i must first explain the warning at the top of the associated code section: the second value is stored in the instruction word, that means, anything put there can cause any opcodes that happen to match to be triggered, if the CPU tries to execute it.&lt;/p&gt;

&lt;p&gt;The table itself, &lt;em&gt;bob&lt;/em&gt;, uses tdat, which has 2 modes:&lt;/p&gt;

&lt;p&gt;singe-cell mode:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;tdat @1;@2;@3
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;double-cell mode:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;tdat @1 :a;@2 :b;@3 :c
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;A few things to note here:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Do not place semicolons at either end!&lt;/li&gt;
&lt;li&gt;DO NOT try to use integer variables. the tables are statically compiled, and REQUIRE use of any of the 3 literal types (decimal, ternary, and character).&lt;/li&gt;
&lt;li&gt;the left value in tdat double-cell mode is accessed using the methods below, while the right value is accessed like in any of the other table types.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  reading the extra value.
&lt;/h3&gt;

&lt;p&gt;as you might deduce, reading the extra value is as simple as suffixing the tab* operations with '2':&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;tabr2 table,x,y
tabw2 table,x,y,value
tabcd2 table,x,y
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;As you can see, syntax is identical, and its fairly simple to actually use.&lt;/p&gt;

&lt;h1&gt;
  
  
  Compiling &amp;amp; running
&lt;/h1&gt;

&lt;p&gt;just as in part 1:&lt;/p&gt;

&lt;p&gt;compile: &lt;code&gt;./stnpcom.py tutorial_example_2&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;run: &lt;code&gt;/SBTCVM_G2_9.py tutorial_example_2&lt;/code&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  so how are tables useful in SSTNPL? How did they come about?
&lt;/h1&gt;

&lt;p&gt;Well, the whole table system was inspired by the data lookup algorithm of a prototype of a &lt;a href="https://github.com/SBTCVM/SBTCVM-Gen2-9/blob/master/apps/maze/auto_main.stnp"&gt;maze engine&lt;/a&gt; i wrote in SSTNPL (that actually works by the way), and so far has gone on to power &lt;a href="https://github.com/SBTCVM/SBTCVM-Gen2-9/blob/master/apps/match/auto_main.stnp"&gt;a card-matching game&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;As far as what could be done with them, that's a question only time, and a bit of experimentation, will really answer.&lt;/p&gt;

&lt;h1&gt;
  
  
  Where can i read more?
&lt;/h1&gt;

&lt;p&gt;well you can find SSTNPL's full documentation &lt;a href="https://github.com/SBTCVM/SBTCVM-Gen2-9/tree/master/textdocs/SSTNPL"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Whats next?
&lt;/h1&gt;

&lt;p&gt;In part 3, we will look at how SSTNPL's single and double iterators work, and how they can be used to iterate over tables, and even help populate them.&lt;/p&gt;

</description>
      <category>sbtcvm</category>
      <category>ternary</category>
      <category>sstnpl</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>SBTCVM's SSTNPL, Part 1: basics</title>
      <dc:creator>Thomas Leathers</dc:creator>
      <pubDate>Sat, 13 Oct 2018 19:34:10 +0000</pubDate>
      <link>https://forem.com/thomasthespacefox/sbtcvms-sstnpl-part-1-basics-3a7h</link>
      <guid>https://forem.com/thomasthespacefox/sbtcvms-sstnpl-part-1-basics-3a7h</guid>
      <description>&lt;p&gt;SBTCVM, being as different to binary as any balanced ternary computer, virtual or not, has plenty of differences that keep existing languages from it (without a shipload of work that is)&lt;/p&gt;

&lt;p&gt;In light of this, i wound up creating a second programming language for it, called SSTNPL, or SBTCVM Simplified Ternary Numeric Programming Language. This is the beginning of a series of tutorials on its use, and best practices when working with it.&lt;/p&gt;

&lt;p&gt;In part 1, we will take a look at using the 'keyprompt' command in two types of menus, to create a simple program that lets a user change a boolean value.&lt;/p&gt;

&lt;h2&gt;
  
  
  getting started
&lt;/h2&gt;

&lt;p&gt;First thing you'll need is &lt;a href="https://github.com/SBTCVM/SBTCVM-Gen2-9"&gt;SBTCVM gen 2-9&lt;/a&gt;, SBTCVM's latest and greatest iteration, featuring among other things, SSTNPL's compiler.&lt;/p&gt;

&lt;p&gt;Once you have that, you can proceed with creating a *.stnp file in the VMUSER directory. (note: if you prefix the .stnp with 'auto_' you can also place it in a subdirectory there)&lt;/p&gt;

&lt;p&gt;For this tutorial however, i recommend downloading the example program from the gist embedded in the following section, and placing the *.stnp in VMUSER. &lt;/p&gt;

&lt;h2&gt;
  
  
  The code
&lt;/h2&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;To make things easier, i marked each section clearly with comments &lt;code&gt;#### LIKE THIS ####&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Vars
&lt;/h2&gt;

&lt;p&gt;First off, lets look at the &lt;strong&gt;VARS&lt;/strong&gt; section. as SSTNPL is fairly static, we need to let it know what variables we will be using. We do this with the &lt;code&gt;var&lt;/code&gt; statement:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;var varname=@10&lt;/code&gt;&lt;br&gt;
&lt;code&gt;var varname2=+0-&lt;/code&gt;&lt;br&gt;
&lt;code&gt;var varname3=:a&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The first example uses signed decimal, via the @ prefix.&lt;br&gt;
The second is plain balanced ternary.&lt;br&gt;
The third uses the given character's code value in SBTCVM's text encoding. This means integer variables can act as 'characters' as well.&lt;/p&gt;

&lt;h2&gt;
  
  
  Main
&lt;/h2&gt;

&lt;h4&gt;
  
  
  Now, lets take a look at &lt;strong&gt;MAIN&lt;/strong&gt;.
&lt;/h4&gt;

&lt;p&gt;first, we see a &lt;code&gt;label&lt;/code&gt;. This lets us use both &lt;code&gt;goto&lt;/code&gt; and &lt;code&gt;gsub&lt;/code&gt; (subroutine goto) to jump to that location.&lt;/p&gt;

&lt;h4&gt;
  
  
  Following that we see some text output code:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;print: prints raw text&lt;/li&gt;
&lt;li&gt;prline: prints raw text, but appends a newline&lt;/li&gt;
&lt;li&gt;newline: prints a newline character&lt;/li&gt;
&lt;li&gt;dumpd: dumps the specified variable in signed decimal as this is used to print our boolean value (called &lt;code&gt;value&lt;/code&gt;)&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Keyprompt and set:
&lt;/h4&gt;

&lt;p&gt;&lt;code&gt;keyprompt&lt;/code&gt; Is a input loop macro that waits for the user to press a key, then continues.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;set&lt;/code&gt; is used to set values returned by several operations to variables.&lt;br&gt;
 here, we &lt;code&gt;set&lt;/code&gt; the variable &lt;code&gt;kb&lt;/code&gt; to the value returned by &lt;code&gt;keyprompt&lt;/code&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Conditional subroutine gotos (gsub's):
&lt;/h4&gt;

&lt;p&gt;Its at this point in &lt;code&gt;main&lt;/code&gt; that we check &lt;code&gt;kb&lt;/code&gt; against literal character values (letters prefixed with a &lt;code&gt;:&lt;/code&gt;)&lt;/p&gt;

&lt;p&gt;&lt;code&gt;if kb,:q gsub quit&lt;/code&gt; If &lt;code&gt;kb&lt;/code&gt; is equal to the character code of &lt;code&gt;q&lt;/code&gt;, call &lt;code&gt;quit&lt;/code&gt; as a subroutine&lt;/p&gt;

&lt;h4&gt;
  
  
  goto:
&lt;/h4&gt;

&lt;p&gt;as you might guess, we need to loop here. since we have a label at the top of main, we can jump there:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;goto main&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;goto&lt;/code&gt; both by itself and in conditionals, does not affect return, while &lt;code&gt;gsub&lt;/code&gt; does. This lets you do complex jumps within subroutines, so its important to note.&lt;/p&gt;

&lt;h2&gt;
  
  
  quit:
&lt;/h2&gt;

&lt;p&gt;On a quick touch, exiting an SSTNPL program is simple enough. just use:&lt;br&gt;
&lt;code&gt;stop&lt;/code&gt;&lt;br&gt;
This will neatly shutdown the VM.&lt;/p&gt;

&lt;h2&gt;
  
  
  number:
&lt;/h2&gt;

&lt;p&gt;This section is similar to main, but its acting as a 'value selection' rather than a 'subroutine selection'&lt;/p&gt;

&lt;h4&gt;
  
  
  retflg reset:
&lt;/h4&gt;

&lt;p&gt;looking past the label, we see &lt;code&gt;val&lt;/code&gt;. This, when used with &lt;code&gt;set&lt;/code&gt; can be used to directly change the value of variables. here, we use it to reset a return flag.&lt;/p&gt;

&lt;h4&gt;
  
  
  subroutine loop:
&lt;/h4&gt;

&lt;p&gt;after a nifty &lt;code&gt;prline&lt;/code&gt; message telling the user to press 1 or 0, we then run &lt;code&gt;keyprompt&lt;/code&gt; in a loop as before. &lt;code&gt;label number_loop&lt;/code&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  conditional variable set:
&lt;/h4&gt;

&lt;p&gt;how this 'value selector' works, is it uses pairs of conditional variable sets of both our boolean value variable &lt;code&gt;value&lt;/code&gt; and our return flag &lt;code&gt;retflg&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;if kb,:0 =retflg @1&lt;/code&gt;&lt;br&gt;
&lt;code&gt;if kb,:0 =value @0&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Ooh what have we here? literal decimal integers, using the &lt;code&gt;@&lt;/code&gt; prefix.&lt;br&gt;
this variable set mode works by setting the variable immediately following the &lt;code&gt;=&lt;/code&gt; sign, and using the variable or literal just next to that as the data value to use. so if you had a variable called &lt;code&gt;bob&lt;/code&gt; and wanted to set using that:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;if kb,:0 =value bob&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;while we are talking about literals i should mention the ternary literal:&lt;/p&gt;

&lt;p&gt;if kb,:0 =value *+0-&lt;/p&gt;

&lt;p&gt;same idea as the decimal and character literals, just with a &lt;code&gt;*&lt;/code&gt; prefix.&lt;/p&gt;

&lt;h4&gt;
  
  
  conditional return:
&lt;/h4&gt;

&lt;p&gt;handily, we can conditionally return from subroutines in SSTNPL using conditionals, rather than the usual &lt;code&gt;return&lt;/code&gt; command, we do:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;if retflg,@1 return&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This means it will only return when &lt;code&gt;value&lt;/code&gt; has been set via the user either pressing 1 or 0.&lt;/p&gt;

&lt;h4&gt;
  
  
  loop
&lt;/h4&gt;

&lt;p&gt;As before, we jump to the label we used for the beginning of the loop.&lt;br&gt;
&lt;code&gt;goto number_loop&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  compiling and running:
&lt;/h2&gt;

&lt;p&gt;easy enough:&lt;/p&gt;

&lt;p&gt;compile: &lt;code&gt;./stnpcom.py tutorial_example&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;run: &lt;code&gt;./SBTCVM_G2_9.py tutorial_example&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion:
&lt;/h2&gt;

&lt;p&gt;SSTNPL is fairly low-level, but that doesn't mean it isn't quite useful, if you want to mess around with SBTCVM, and lack good understanding of low level computing.&lt;/p&gt;

&lt;p&gt;The takeaway from this, is other than the underlying logic, the overall structure of balanced ternary machines are similar to binary ones, as they both are digital computers and need to be programmed. Hope you found this interesting.&lt;/p&gt;

&lt;p&gt;You can find more information on SSTNPL at these links:&lt;br&gt;
&lt;a href="https://github.com/SBTCVM/SBTCVM-Gen2-9/tree/master/textdocs/SSTNPL"&gt;SSTNPL documentation&lt;/a&gt;&lt;br&gt;
&lt;a href="https://sbtcvm.blogspot.com/p/sstnpl-guide.html"&gt;General SSTNPL Guide&lt;/a&gt;&lt;/p&gt;

</description>
      <category>sbtcvm</category>
      <category>ternary</category>
      <category>sstnpl</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>pygame, gopherspace, and window managers</title>
      <dc:creator>Thomas Leathers</dc:creator>
      <pubDate>Mon, 24 Sep 2018 15:35:17 +0000</pubDate>
      <link>https://forem.com/thomasthespacefox/pygame-gopherspace-and-window-managers-3ffi</link>
      <guid>https://forem.com/thomasthespacefox/pygame-gopherspace-and-window-managers-3ffi</guid>
      <description>&lt;p&gt;Some people may think pygame is mostly useful for games and multimedia, that's not all its useful for. Some people may also think you can't use multiple windows in pygame. While the latter is true, i managed to work around that.&lt;/p&gt;

&lt;h1&gt;
  
  
  What is gopherspace
&lt;/h1&gt;

&lt;p&gt;First off, I want to give a brief description of what gopherspace actually is. &lt;/p&gt;

&lt;p&gt;Way back before the web, in the year 1991, a new protocol emerged onto the internet. Gopher. Rather than being hyper text, or as crude as a FTP directory listing, gopher is kinda in-between.&lt;/p&gt;

&lt;p&gt;Gopherspace is really just one big series of menus. No scripts, no more formatting than a plain .txt document, and no CSS.  Over the years, gopher slid into obsucurity. However, its still out there, in part to its absurdly simple protocol:&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1:
&lt;/h3&gt;

&lt;p&gt;client connects to server.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2:
&lt;/h3&gt;

&lt;p&gt;client sends a 'selector' aka path of the desired document, a tap+query if its a search query, and a CR+LF.:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/some/document[CRLF]
/some/query[tab]some search terms[CRLF]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  Step 3:
&lt;/h3&gt;

&lt;p&gt;Client waits for server to send the full document/file selected, or, if an error occurs, usually an error page containing item type '3'&lt;/p&gt;
&lt;h2&gt;
  
  
  The Menus:
&lt;/h2&gt;

&lt;p&gt;A gopher menu's synax probably couldn't be simpler (literally):&lt;br&gt;
usually the port is 70. The first char of each line defines the item's type.&lt;br&gt;
notice the 'i' type has a 'null' selector field, as its not supposed to be even selectable.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;iI'm an information type[tab]null[tab]server[tab]port[CRLF]
1I'm a gopher menu somewhere[tab]/this/is/a/selector/[tab]server[tab]port[CRLF]
0I'm a text document somewhere[tab]/this/is/a/selector/also.txt[tab]server[tab]port[CRLF]
7I'm a text query (or index search) somewhere[tab]/some/search[tab]server[tab]port[CRLF]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;a type '3' is returned upon an error of some kind. most commonly a nonexistent selector, which is akin to a 404 error.&lt;/p&gt;

&lt;p&gt;There are plenty of other types and things, but that's the basics.&lt;/p&gt;
&lt;h1&gt;
  
  
  how i got around pygame/sdl's 1-window limit (sort of ;D )
&lt;/h1&gt;

&lt;p&gt;Now to the fun part. how do you run multiple windows, while you only have 1?&lt;br&gt;
a virtual window manager.&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--i3JOwpme--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/github-logo-ba8488d21cd8ee1fee097b8410db9deaa41d0ca30b004c0c63de0a479114156f.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/ThomasTheSpaceFox"&gt;
        ThomasTheSpaceFox
      &lt;/a&gt; / &lt;a href="https://github.com/ThomasTheSpaceFox/Strazoloid-windowing-framework"&gt;
        Strazoloid-windowing-framework
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Strazoloid is a virtual window manager for pygame applications &amp;amp; games. Useful for creating custom multi-window enviornments. such as with many 2D simulation games.
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;h1&gt;
Strazoloid windowing framework&lt;/h1&gt;
&lt;p&gt;v1.4.0&lt;br&gt;
a Python/pygame virtual window manager framework.&lt;br&gt;
Copyright (c) 2018-2020 Thomas Leathers and Contributors&lt;/p&gt;
&lt;p&gt;Need help? For documentation &lt;a href="https://raw.githubusercontent.com/ThomasTheSpaceFox/Strazoloid-windowing-framework/master/./docs/index.md"&gt;see the docs directory&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Strazoloid windowing framework is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.&lt;/p&gt;
&lt;p&gt;Strazoloid windowing framework is distributed in the hope that it will be useful
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.&lt;/p&gt;
&lt;p&gt;You should have received a copy of the GNU General Public License
along with Strazoloid windowing framework.  If not, see &lt;a href="http://www.gnu.org/licenses/" rel="nofollow"&gt;http://www.gnu.org/licenses/&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;all images and other media content, unless otherwise noted
are licensed under the Creative Commons Attribution-ShareAlike 4.0
International License. To view a…&lt;/p&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/ThomasTheSpaceFox/Strazoloid-windowing-framework"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;



&lt;p&gt;I actually had already written the basic structure of strazoloid before working on zoxenpher, but it was greatly improved.&lt;/p&gt;

&lt;p&gt;Starting up strazoloidwm is easy enough:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;strazoloidwm&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;stz&lt;/span&gt;
&lt;span class="n"&gt;desk&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;stz&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;desktop&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;800&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;600&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"This is the window title"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;pumpcall&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;event_test&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;resizable&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="c1"&gt;#init Framework
&lt;/span&gt;&lt;span class="n"&gt;framesc&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;stz&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;framescape&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;desk&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="c1"&gt;#create new 'framex' object (virtual window)
&lt;/span&gt;&lt;span class="n"&gt;testframe2&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;stz&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;framex&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"test2"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;pumpcall&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;event_test&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="c1"&gt;#add the frame (window) to our framescape instance.
&lt;/span&gt;&lt;span class="n"&gt;framesc&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;add_frame&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;testframe2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="c1"&gt;#hand over main thread to framescape instance, starting the window manager.
&lt;/span&gt;&lt;span class="n"&gt;framesc&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;process&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;whats &lt;code&gt;event_test&lt;/code&gt; you might ask? well:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;event_test&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;frameobj&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="c1"&gt;#note: you should make sure all non if-statement code is behind if statements. see comments on frame/desktop flags below.
&lt;/span&gt;    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;frameobj&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;statflg&lt;/span&gt;&lt;span class="o"&gt;==&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;frameobj&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;" stat 1: init call"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;elif&lt;/span&gt; &lt;span class="n"&gt;frameobj&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;statflg&lt;/span&gt;&lt;span class="o"&gt;==&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;frameobj&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;" stat 2: post-resize call"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;elif&lt;/span&gt; &lt;span class="n"&gt;frameobj&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;statflg&lt;/span&gt;&lt;span class="o"&gt;==&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;frameobj&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;" stat 3: frame terminate call. type:"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;frameobj&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;runflg&lt;/span&gt;&lt;span class="o"&gt;==&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"   run 0: wm quit call"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;frameobj&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;pid&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;frameobj&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;wo&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;frameobj&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;runflg&lt;/span&gt;&lt;span class="o"&gt;==&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="c1"&gt;#the desktop class should never set runflg=2
&lt;/span&gt;            &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"   run 2: frame (window) close call"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;frameobj&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;pid&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;frameobj&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;wo&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;elif&lt;/span&gt; &lt;span class="n"&gt;frameobj&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;statflg&lt;/span&gt;&lt;span class="o"&gt;==&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;frameobj&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;" stat 4: clickdown"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;elif&lt;/span&gt; &lt;span class="n"&gt;frameobj&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;statflg&lt;/span&gt;&lt;span class="o"&gt;==&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;frameobj&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;" stat 5: clickup"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;elif&lt;/span&gt; &lt;span class="n"&gt;frameobj&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;statflg&lt;/span&gt;&lt;span class="o"&gt;==&lt;/span&gt;&lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;frameobj&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;" stat 6: keydown"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;elif&lt;/span&gt; &lt;span class="n"&gt;frameobj&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;statflg&lt;/span&gt;&lt;span class="o"&gt;==&lt;/span&gt;&lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;frameobj&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;" stat 7: keyup"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;elif&lt;/span&gt; &lt;span class="n"&gt;frameobj&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;statflg&lt;/span&gt;&lt;span class="o"&gt;==&lt;/span&gt;&lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;frameobj&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;" stat 8: desktop window resize"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;elif&lt;/span&gt; &lt;span class="n"&gt;frameobj&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;statflg&lt;/span&gt;&lt;span class="o"&gt;==&lt;/span&gt;&lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;frameobj&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;" stat 9: frame shade"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;elif&lt;/span&gt; &lt;span class="n"&gt;frameobj&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;statflg&lt;/span&gt;&lt;span class="o"&gt;==&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
                &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;frameobj&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;" stat 10: frame unshade"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Whats all the statflg checks? well. that's how strazoloidwm lets the program know, what reason frame/desktop object's 'pumpcall' was called.  Note that pumpcall can easily be a class instance method. &lt;/p&gt;

&lt;p&gt;You can find a full test program &lt;a href="https://github.com/ThomasTheSpaceFox/Strazoloid-windowing-framework/blob/master/stz-test.py"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;h1&gt;
  
  
  Zoxenpher
&lt;/h1&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--i3JOwpme--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/github-logo-ba8488d21cd8ee1fee097b8410db9deaa41d0ca30b004c0c63de0a479114156f.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/ThomasTheSpaceFox"&gt;
        ThomasTheSpaceFox
      &lt;/a&gt; / &lt;a href="https://github.com/ThomasTheSpaceFox/Zoxenpher"&gt;
        Zoxenpher
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      A python/pygame gopherspace client, in the style of a retro desktop GUI.
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;h1&gt;
Zoxenpher&lt;/h1&gt;
&lt;p&gt;A python &amp;amp; pygame gopher client.&lt;br&gt;
v3.0.0.indev&lt;/p&gt;
&lt;p&gt;powered by:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;libgop gopher library v0.2&lt;/li&gt;
&lt;li&gt;strazoloid virtual window manager framework v1.4.0&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a rel="noopener noreferrer" href="https://raw.githubusercontent.com/ThomasTheSpaceFox/Zoxenpher/master//vgop/screenshots/zoxenpher1.jpg"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--QkQJJzxj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/ThomasTheSpaceFox/Zoxenpher/master/vgop/screenshots/zoxenpher1.jpg" alt="Screenshot of Zoxenpher"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Copyright (c) 2018-2020 Thomas Leathers and contributors&lt;/p&gt;
&lt;p&gt;Zoxenpher is free software: you can redistribute it and/or modify&lt;br&gt;
it under the terms of the GNU General Public License as published by&lt;br&gt;
the Free Software Foundation, either version 3 of the License, or&lt;br&gt;
(at your option) any later version.&lt;/p&gt;
&lt;p&gt;Zoxenpher is distributed in the hope that it will be useful,&lt;br&gt;
but WITHOUT ANY WARRANTY; without even the implied warranty of&lt;br&gt;
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the&lt;br&gt;
GNU General Public License for more details.&lt;/p&gt;
&lt;p&gt;You should have received a copy of the GNU General Public License&lt;br&gt;
along with Zoxenpher.  If not, see &lt;a href="http://www.gnu.org/licenses/" rel="nofollow"&gt;http://www.gnu.org/licenses/&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;all images and other media content, unless otherwise noted,&lt;br&gt;
are licensed under the Creative Commons Attribution-ShareAlike 4.0&lt;br&gt;
International License. To view a copy of this license…&lt;/p&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/ThomasTheSpaceFox/Zoxenpher"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&lt;br&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--hRvSqe_A--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/5if5xunhqi8ua0o4wq7v.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--hRvSqe_A--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/5if5xunhqi8ua0o4wq7v.jpg" alt="Screenshot of zoxenpher"&gt;&lt;/a&gt;&lt;br&gt;&lt;br&gt;
Combining a custom gopher parser/access library, and some implementation-specific code, and the power of strazoloidwm, zoxenpher Is a neat gopher client sure,  i was able to get the basic functionality up and going quite quickly, as much of the grunt work was already handled by strazoloidwm.&lt;/p&gt;

&lt;p&gt;Its complete with bookmarks, window-history navigation, images and even sound type support. plus using pygame allowed me to give it a bit of a retro-ish look that fits the protocol quite well i think.&lt;/p&gt;

</description>
      <category>showdev</category>
      <category>python</category>
      <category>pygame</category>
      <category>gopherspace</category>
    </item>
    <item>
      <title>I'm the lead developer of SBTCVM, a FOSS balanced ternary VM project, Ask Me Anything!</title>
      <dc:creator>Thomas Leathers</dc:creator>
      <pubDate>Thu, 09 Aug 2018 15:55:43 +0000</pubDate>
      <link>https://forem.com/thomasthespacefox/im-the-lead-developer-of-sbtcvm-a-foss-balanced-ternary-vm-project-ask-me-anything-15ob</link>
      <guid>https://forem.com/thomasthespacefox/im-the-lead-developer-of-sbtcvm-a-foss-balanced-ternary-vm-project-ask-me-anything-15ob</guid>
      <description></description>
      <category>ama</category>
    </item>
    <item>
      <title>Balanced Ternary Fibonacci, in a new language.</title>
      <dc:creator>Thomas Leathers</dc:creator>
      <pubDate>Mon, 06 Aug 2018 17:28:48 +0000</pubDate>
      <link>https://forem.com/thomasthespacefox/balanced-ternary-fibonacci-in-a-new-language-302a</link>
      <guid>https://forem.com/thomasthespacefox/balanced-ternary-fibonacci-in-a-new-language-302a</guid>
      <description>&lt;h2&gt;
  
  
  Overview:
&lt;/h2&gt;

&lt;p&gt;SBTCVM is a balanced ternary (a variant of ternary that uses a negative digit instead of 2) virtual machine written in python. &lt;/p&gt;

&lt;p&gt;Recently, I and the rest of the SBTCVM developers have been hammering away at a new, 6.5Khz, modular, codebase called '&lt;strong&gt;SBTCVM Gen 2&lt;/strong&gt;'. Its still in alpha, but its definitely making progress, and can already run moderately complex math programs, and print their output to a virtual TTY.&lt;/p&gt;

&lt;p&gt;For those of you who saw my previous post on &lt;a href="https://dev.to/thomasthespacefox/calculating-fibonacci-in-balanced-ternary"&gt;Fibonacci in balanced ternary&lt;/a&gt;, you probably already know, SBTCVM's old codebase only had an assembler. Well...&lt;/p&gt;

&lt;h2&gt;
  
  
  SBTCVM's new SSTNPL (SBTCVM Simplified Ternary Numeric Programming Language)
&lt;/h2&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;
&lt;br&gt;
SO, Whats going on here? well, this is the new, abstracted, primarily-numeric, language, built for SBTCVM gen2, thats not a week old.
&lt;h3&gt;
  
  
  basics:
&lt;/h3&gt;

&lt;p&gt;SSTNPL is a language built primarily for mathematics. its driven by a seamless, named-integer-variable system. Its main goal is to abstract the complexities of the Virtual machine enough to provide a nice abstract language for learning Balanced Ternary mathematics, and doing calculations.&lt;/p&gt;
&lt;h3&gt;
  
  
  var
&lt;/h3&gt;

&lt;p&gt;var = is how we create variables for use &amp;amp; change later. (you must call var for every variable you use, regardless of whether it needs a starting value. Also most operations (other than a val  followed by a 'set' statement), only take variable names as arguments.&lt;/p&gt;

&lt;p&gt;value can have 2 forms:&lt;/p&gt;

&lt;p&gt;prefix the value with '10x' if you wish to use decimal. i.e.&lt;br&gt;
&lt;strong&gt;10x-59&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;otherwise you can use ternary in both &lt;strong&gt;+0-&lt;/strong&gt; and &lt;strong&gt;p0n&lt;/strong&gt; notations.&lt;/p&gt;
&lt;h3&gt;
  
  
  Result printing:
&lt;/h3&gt;

&lt;p&gt;here we have two strange commands:&lt;br&gt;
&lt;strong&gt;dumpd&lt;/strong&gt; and &lt;strong&gt;dumpt&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;dumpd dumps the specified integer in decimal form&lt;br&gt;
dumpt does the same, but in ternary form.&lt;/p&gt;

&lt;p&gt;newline and space are just TTY macros intended for formatting.&lt;/p&gt;
&lt;h3&gt;
  
  
  end condition:
&lt;/h3&gt;

&lt;p&gt;the conditional goto. you might notice that it takes 3 arguments. 2 operators that are comma-separated, and a label to actually jump to.&lt;/p&gt;

&lt;p&gt;there are actually 3 types: if(equals), ifmore, and ifless. (this is no coincidence, as SBTCVM's new CPU also has these 3)&lt;/p&gt;
&lt;h3&gt;
  
  
  math
&lt;/h3&gt;

&lt;p&gt;add does just what you'd expect. It adds the two specified arguments. But how do we get our result?&lt;/p&gt;

&lt;p&gt;thats the job of 'set' in this example, we 'set' num0 to the result of the previous operation.&lt;/p&gt;

&lt;p&gt;swap, just switches the values of the two arguments.&lt;/p&gt;

&lt;p&gt;And finally we just do 'goto loop' to return to the top of our loop at 'label loop', and then write a small exit routine to jump to in our conditional, and we have a program.&lt;/p&gt;

&lt;p&gt;When we build this SSTNPL program into a memory image (.trom) and run it, via the &lt;strong&gt;stnpcom.py&lt;/strong&gt; compiler and SBTCVM gen 2's curses VM frontend, the logged output looks like so:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;SBTCVM's new codebase can be found here, and works in both python2 and python3:&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/SBTCVM" rel="noopener noreferrer"&gt;
        SBTCVM
      &lt;/a&gt; / &lt;a href="https://github.com/SBTCVM/SBTCVM-Gen2-9" rel="noopener noreferrer"&gt;
        SBTCVM-Gen2-9
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      SBTCVM is a virtual machine implementation of a balanced ternary (base 3) computer. Features several compiled languages for ternary software development.
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;SBTCVM Gen2-9&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;Simple Balanced Ternary Computer Virtual Machine&lt;/p&gt;
&lt;p&gt;v2.1.0.alpha&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Need Help? &lt;a href="https://github.com/SBTCVM/SBTCVM-Gen2-9/guide.md" rel="noopener noreferrer"&gt;See our Getting started guide&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://sbtcvm.blogspot.com/" rel="nofollow noopener noreferrer"&gt;SBTCVM Project blog&lt;/a&gt;&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;What is SBTCVM?&lt;/h2&gt;
&lt;/div&gt;
&lt;p&gt;Ever wonder what computers other than the boring-old binary would be like? Well, look no further
SBTCVM, a python-written VM, simulates the little-known base number called Balanced Ternary!&lt;/p&gt;
&lt;p&gt;What is balanced ternary? well, it has "0" and "+1", just like binary,
but added into the mix is a "-1"! Yes, this means EVERY number is signed.&lt;/p&gt;
&lt;p&gt;Intrigued? Well, as
SBTCVM is Free &amp;amp; Open Source Software, and comes with a ready-to-use
set of compilers and development tools, Getting started with balanced
ternary with SBTCVM, should prove a fun challenge!&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Screenshots:&lt;/h2&gt;

&lt;/div&gt;
&lt;p&gt;&lt;a rel="noopener noreferrer" href="https://github.com/SBTCVM/SBTCVM-Gen2-9/textdocs/screenshots/tritmap.png"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2FSBTCVM%2FSBTCVM-Gen2-9%2Ftextdocs%2Fscreenshots%2Ftritmap.png" alt="'tritmap_heavy' TROM: High resolution Compressed image demo"&gt;&lt;/a&gt;
&lt;a rel="noopener noreferrer" href="https://github.com/SBTCVM/SBTCVM-Gen2-9/textdocs/screenshots/fttarget.png"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2FSBTCVM%2FSBTCVM-Gen2-9%2Ftextdocs%2Fscreenshots%2Ffttarget.png" alt="'fttarget' TROM: Falling Ternary Targets Game"&gt;&lt;/a&gt;
&lt;a rel="noopener noreferrer" href="https://github.com/SBTCVM/SBTCVM-Gen2-9/textdocs/screenshots/monitor1.png"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2FSBTCVM%2FSBTCVM-Gen2-9%2Ftextdocs%2Fscreenshots%2Fmonitor1.png" alt="'clicalc' TROM's memory monitor"&gt;&lt;/a&gt;
&lt;a rel="noopener noreferrer" href="https://github.com/SBTCVM/SBTCVM-Gen2-9/textdocs/screenshots/ontrain1.png"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2FSBTCVM%2FSBTCVM-Gen2-9%2Ftextdocs%2Fscreenshots%2Fontrain1.png" alt="'ontrain' TROM: Oncoming Trains game"&gt;&lt;/a&gt;
&lt;a rel="noopener noreferrer" href="https://github.com/SBTCVM/SBTCVM-Gen2-9/textdocs/screenshots/bench1.png"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2FSBTCVM%2FSBTCVM-Gen2-9%2Ftextdocs%2Fscreenshots%2Fbench1.png" alt="SBTCVM's GUI desktop 'bench' TROM/disk, showing its info screen."&gt;&lt;/a&gt;
&lt;a rel="noopener noreferrer" href="https://github.com/SBTCVM/SBTCVM-Gen2-9/textdocs/screenshots/bench2.png"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2FSBTCVM%2FSBTCVM-Gen2-9%2Ftextdocs%2Fscreenshots%2Fbench2.png" alt="Bench desktop"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Features:&lt;/h2&gt;

&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;bundled ternary software. including demos, games and utilities.&lt;/li&gt;
&lt;li&gt;4 channel sound chip&lt;/li&gt;
&lt;li&gt;6.5Khz, 9-trit CPU&lt;/li&gt;
&lt;li&gt;3.25Khz 9-trit Coprocessor&lt;/li&gt;
&lt;li&gt;39.388 KiloNonets of system RAM&lt;/li&gt;
&lt;li&gt;pygame frontend features color graphics.&lt;/li&gt;
&lt;li&gt;multiple specialized programming languages with integrated compilers. (SSTNPL, SBTCVM…&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/SBTCVM/SBTCVM-Gen2-9" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


</description>
      <category>sbtcvm</category>
      <category>ternary</category>
      <category>fibonacci</category>
    </item>
    <item>
      <title>Ternary, Trytes, and Python: The Story of a VM.</title>
      <dc:creator>Thomas Leathers</dc:creator>
      <pubDate>Fri, 29 Dec 2017 23:52:08 +0000</pubDate>
      <link>https://forem.com/thomasthespacefox/ternary-trytes-and-python-the-story-of-a-vm-dnj</link>
      <guid>https://forem.com/thomasthespacefox/ternary-trytes-and-python-the-story-of-a-vm-dnj</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;SBTCVM, that's Simple Balanced Ternary Computer Virtual Machine, is just that. A virtual machine that uses 3-state logic. but What drove me to write such a program? Well, the story of SBTCVM starts with a rather simple program.  SBTCVM would not be possible if it wasn't for a particular python module called libbaltcalc.  The origin of it is a Balanced ternary calculator, sure enough called BalTcalc. &lt;/p&gt;

&lt;h2&gt;
  
  
  How it all Started
&lt;/h2&gt;

&lt;p&gt;It was over a year and a half ago... late may to early June, 2016. I was reading Wikipedia article after Wikipedia article, as sometimes happens to many of us, and happened across Balanced Ternary. A nonstandard variant of Base 3. I don't recall exactly what caught my eye about it, but something did, as in early June i put a balanced ternary calculator on GitHub.&lt;/p&gt;

&lt;p&gt;this calculator wasn't much, just simple add, subtract, multiply and integer division, along with 2-way base conversion to decimal.  It was only usable in a terminal.  It did however, leave me with a library that could work with balanced ternary integers, and convert them to and from decimal, and It is this library that would power the most complex python project i have ever worked on...&lt;/p&gt;

&lt;h2&gt;
  
  
  Enter the VM:
&lt;/h2&gt;

&lt;p&gt;TDA Mark 1 was no Ternary supercomputer, the D in TDA literally stood for "Demonstration". It featured 4-trit instructions and 6-trit data. It didn't have a lot of the features SBTCVM has today, but what Mark 1 did introduce helped pave the way for SBTCVM.  TDA did introduce a text encoding, and what eventually evolved into SBTCVM's assembler.&lt;/p&gt;

&lt;p&gt;SBTCVM Mark 1.1 was more of a revival than anything else, but the most important feature It introduced was Full rewritable program memory, as until 1.1, the program memory was treated as ROM. &lt;/p&gt;

&lt;p&gt;SBTCVM Mark 2 is the latest in the original branch of SBTCVM, and has been in development for around 10 months, has thousands of lines of code, and even a framebuffered display. It features 6-trit instructions, and 9-trit data, unlike its two predecessors. Mark 2 also marks when SBTCVM became more of a suite of utilities, centered around the VM itself.  The assembler is more capable than ever, and while not as flexible as what the next codebase will bring, It is still quite useful in the meantime.&lt;/p&gt;

&lt;h2&gt;
  
  
  The future:
&lt;/h2&gt;

&lt;p&gt;SBTCVM's next generation codebase is in early development. And while the new codebase has a vastly different design under the hood, It builds on what was learned with the old codebase, while looking towards the future.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I learned:
&lt;/h2&gt;

&lt;p&gt;Working on the SBTCVM project has taught me some important lessons:&lt;/p&gt;

&lt;p&gt;Documentation can be boring, but it is endlessly useful. Even if you designed most of the working of a program, and think you will remember, write it down. It will help both you, others helping you, and the user. &lt;/p&gt;

&lt;p&gt;Don't be afraid to try new ideas. Even if you wind up being the only project of its kind on GitHub, don't let that stop you.  The best way to get your ideas realized is to get coding!&lt;/p&gt;

&lt;p&gt;Don't pretend there is a deadline when there isn't. Taking one's time can really help.  You will do much better on your projects if you just take the time to stop, think, and read over your code.&lt;/p&gt;

&lt;p&gt;You Never know where a program will take you. Programming is both predicable, and as unpredictable as a random number generator. Often at the same time. Whats most important is to keep working at your ideas, and you might just get there.&lt;/p&gt;

</description>
      <category>python</category>
      <category>ternary</category>
    </item>
  </channel>
</rss>
