Mock-ups for tangentcode/platform#16 (mobile recording mode)
Mockups for tangentcode/platform #517: build-log plugin config toggle and internal/public changelog modes.
| on view do | |
| c.pos: c.pos+gamepad.dir * 4 | |
| c.pos: (0,0) | c.pos & card.size - c.size # bounds check | |
| if gamepad.down.action c.pattern:32+random[16] c.fill[] end | |
| end |
| #!k | |
| / [this code was generated and tested via claude, and is in the public domain] | |
| / MCP (Model Context Protocol) server for ngn/k | |
| / Implements JSON-RPC 2.0 over stdio | |
| / Reads requests from stdin and responds on stdout | |
| / Note: Requires persistent stdin connection (as provided by MCP clients) | |
| / Installation in Claude Code (experimental): | |
| / Option 1: Using claude mcp add command | |
| / claude mcp add ngnk /path/to/ngnk/k /path/to/ngnk/mcp.k | |
| / Option 2: Manual JSON configuration |
| > chs('abc')(on('apple')) | |
| { mk: -1, ix: 1, ch: 'p', ib: 'apple', mb: 1 } | |
| > chs('abc')(on('zapple')) | |
| { mk: -1, ix: 0, ch: 'z', ib: 'zapple', mb: 0 } | |
| > chs('zabc')(on('zapple')) | |
| { mk: -1, ix: 1, ch: 'a', ib: 'zapple', mb: 1 } | |
| > chs('abcz')(on('zapple')) | |
| { mk: -1, ix: 1, ch: 'a', ib: 'zapple', mb: 1 } | |
| > chs('abcz')(on('')) | |
| { mk: -1, ix: 0, ch: undefined, ib: '', mb: 0 } |
| # Reset color after command execution | |
| preexec() { | |
| echo -ne "\e[0m" | |
| } | |
| # J language interceptor using ZLE | |
| j-line-intercept() { | |
| local cmd="$BUFFER" | |
| if [[ "$cmd" = "j "* ]]; then |
For the python wrapper, I want to either modify the cursor idea to support a "don't care" concept.
If the path down the bdd skips over a variable, it means we don't care about it. Right now, the solution iterators are designed to explicitly account for this, and do a "ripple carry" operation over the skipped variables. (Basically, we just treat that run of variables as a binary number and keep incrementing it until a variable above it flips.)
But, in the dd python wrapper for bdds, it prefers to skip over the duplicates by simply removing the variables we don't care about from the yielded assignments at each step. ... but it ALSO has a way to opt back in.
Study the code in bdd_sols.rs and come up with a way to do this while still supporting the current "iterate through every solution" behavior.
| {deck} | |
| version:1 | |
| card:0 | |
| size:[512,342] | |
| name:"itemlist.deck" | |
| {card:home} | |
| {widgets} | |
| itemlist1:{"type":"contraption","size":[400,161],"pos":[13,30],"def":"itemlist","widgets":{"label":{},"item_text":{},"items":{},"bnw":{},"bgo":{},"run_event":{},"slider1":{},"bpr":{},"bnx":{},"brm":{},"bup":{},"dn":{}}} |
| // sh.mts: javascript shorthand | |
| // #region array tools | |
| /** id function (returns first argument) */ | |
| export const id=<T,>(x: T): T=>x | |
| /** create an array filled with n copies of x */ | |
| export const af=<T,>(n: number, x: T): T[]=>Array(n).fill(x) // TODO: make this 'afl' or 'fil' (aa?) | |
| /** loop i from 0..n, calling f(i) */ | |
| export const ii=(n: number, f: (i: number)=>void)=>{for(let i=0;i<n;i++)f(i)} | |
| /** map f over [0..n] */ |