Skip to content

Instantly share code, notes, and snippets.

// {"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
// {"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":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":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"}
// 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!"