Skip to content

Instantly share code, notes, and snippets.

// {"enableUpdate":false,"enableVisualMode":false,"enableClearOnUpdate":false,"updateFrequency":4,"gridWidth":20,"gridHeight":20,"throne-playground-script":"0.1.0"}
// enter your guess here:
guess 2
seed 34913906
seed SEED . % SEED 1234 SEED' . % SEED' 10 SECRET = secret SECRET
guess GUESS: {
secret GUESS = "correct!"
secret SECRET . < GUESS SECRET = "too low!"
// {"enableUpdate":true,"enableVisualMode":true,"enableClearOnUpdate":true,"updateFrequency":4,"gridWidth":20,"gridHeight":20,"throne-playground-script":"0.1.0"}
// Conway's Game of Life (https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life):
// 1. Any live cell with two or three live neighbours survives.
// 2. Any dead cell with three live neighbours becomes a live cell.
// 3. All other live cells die in the next generation. Similarly, all other dead cells stay dead.
// glider pattern
cell 1 0
cell 2 1
// {"enableUpdate":false,"enableVisualMode":false,"enableClearOnUpdate":false,"updateFrequency":4,"gridWidth":20,"gridHeight":20,"throne-playground-script":"0.1.0"}
Mary is sister of David
Sarah is child of Mary
Tom is child of David
CHILD is child of PARENT . AUNT is sister of PARENT . COUSIN is child of AUNT = COUSIN is cousin of CHILD
// {"enableUpdate":true,"enableVisualMode":true,"enableClearOnUpdate":false,"updateFrequency":4,"gridWidth":20,"gridHeight":20,"throne-playground-script":"0.1.0"}
draw "🌕" 5 5
draw "🌕" 14 5
draw "🌕" 14 14
draw "🌕" 5 14
draw "👑" 7 8
draw "throne" 7 9
#update . draw "🌕" X Y = draw "🌖" X Y
// {"enableUpdate":true,"enableVisualMode":true,"enableClearOnUpdate":true,"updateFrequency":10,"gridWidth":10,"gridHeight":20,"throne-playground-script":"0.1.0"}
// initialize state
fall-timer 5 . default-fall-timer 5 . block-id 0 . falling-shape-id 0 . max-width 10 . max-height 20
// spawn a shape that will fall, if one doesn't already exist
#update . !shape _X _Y _BLOCKS . falling-shape-id ID . + ID 1 ID' = falling-shape-id ID' . #new-shape
#update . $shape _X _Y _BLOCKS = #input-u
// define available shapes and where they spawn
@t-mw
t-mw / script.gd
Last active May 4, 2020 17:52
Godot Engine AtlasTexture billboard shader
# NB: assumes an orthogonal camera and quad mesh geometry
fn _process(_delta) {
# set this to an instance of AtlasTexture
var atlas_tex = ...
# set this to an instance of Material
var material = ...
# optionally center the sprite around a point relative to the top-left corner
var center = Vector2(0, 0)
#!/bin/bash
# see https://github.com/porglezomp-misc/live-reloading-rs/issues/1
set -e
name="libreloadable"
extension="so"
dir="./target/debug"
path="${dir}/${name}.${extension}"
@t-mw
t-mw / rust-ul-test.rs
Created October 5, 2019 08:41
rust-ul-test.rs
fn main() {
let config = ul::Config::new();
let mut ul_app = ul::UltralightApp::new(Some(config));
ul_app.window(1024u32, 1024u32, false, false, true, true, false);
let mut ul = ul::Ultralight::new(None, Some(ul_app.get_renderer()));
ul.set_view(ul_app.get_view().unwrap());
#!/bin/bash
# see https://github.com/porglezomp-misc/live-reloading-rs/issues/1
set -e
name="libreloadable"
extension="dylib"
dir="./target/debug"
path="${dir}/${name}.${extension}"
@t-mw
t-mw / reload.bash
Created January 26, 2018 18:36
pico-8 live reload
while sleep 1; do
file='test';
lead='__lua__';
tail='__gfx__';
gsed -i -e "/$lead/,/$tail/{ /$lead/{p; r $file.lua
}; /$tail/p; d }" $file.p8;
done