Skip to content

Instantly share code, notes, and snippets.

View ThomasTheSpaceFox's full-sized avatar

Thomas Leathers ThomasTheSpaceFox

View GitHub Profile
#examples of using surface.convert() and surface.convert_alpha()
#do this after calling pygame.display.init() and pygame.display.set_mode()!
mysurface=pygame.image.load("mysurface.png").convert()
mysurface_with_alpha=pygame.image.load("mysurface_with_alpha.png").convert_alpha()
###below is an example of using pygame's pygame.time.Clock class to regulate FPS of game loop.:
#this loop will run at 30 FPS
clock=pygame.time.Clock()
@ThomasTheSpaceFox
ThomasTheSpaceFox / tutorial_example_3.stnp
Created October 22, 2018 18:20
A basic SSTNPL iterator example.
#SSTNPL tutorial part 3: iterators
var cb=0
#### Basic Iterators ####
uiter itval,test1,@-5,@5
newline
diter itval,test1,@5,@-5
newline
#### Double Iterators ####
@ThomasTheSpaceFox
ThomasTheSpaceFox / tutorial_example_2.stnp
Created October 19, 2018 00:50
A basic example of SSTNPL's table system.
#### variable setup ####
var chbuff=0
##### printing VS non-printing #####
prline I print
gsub self_printing_sam
prline I don't print.
gsub non_printing_sam
@ThomasTheSpaceFox
ThomasTheSpaceFox / tutorial_example.stnp
Last active October 13, 2018 19:13
SSTNPL program that presents the user with the option to change a boolean value.
# #### VARS ####
var kb=0
var retflg=0
var value=0
# #### MAIN ####
label main
print boolean value:
dumpd value
@ThomasTheSpaceFox
ThomasTheSpaceFox / SSTNPL_fib_output.txt
Created August 6, 2018 17:25
Log of SSTNPL fibonacci sequence demo's output.
frontend: Curses
Begin UIO tty log:
ready.
1 00000000+
1 00000000+
2 0000000+-
3 0000000+0
5 000000+--
8 000000+0-
13 000000+++
@ThomasTheSpaceFox
ThomasTheSpaceFox / fibsstnpl.stnp
Created August 6, 2018 17:03
Fibonacci sequence in SSTNPL
#Fibonacci sequence in SSTNPL
var endnum=10x4181
#both of these == 1 at first.
var num0=10x1
var num1=+
#this is a short example of how offsetlen acts like a mask.
setreg1|---------
#set mem20 to an arbitrary value to read
setreg2|+0+---++0
IOwrite2|>mem20
#dump register 1 in its full negative state
dumpreg1
#set offset len to radix offset 1, trit length 1
offsetlen|off,1,1
#read memory and dump new state of register 1