generative language scripting
npm install riscriptRiScript is a minor language designed for writers working in computational media. It runs in a variety of environments, including the browser, Node, Observable, P5.js, Android and others. RiScript primitives (choices, symbols, gates, transforms, etc) can be used as part of any RiScript grammar or executed directly using evaluate(). RiScript is free/libre/open-source and optionally integrates with RiTa. It is 100% AI-free software.
For more documentation and examples see this interactive notebook on observable.
* For esm: ``import { RiScript } from "https://esm.sh/riscript";``
* For browsers: `$ npm install riscript
* For node: `
let { RiScript } = require('riscript');`
* For developers
`javascript
import { RiScript } from "https://esm.sh/riscript";
let script = "[#name=[Jane | Bill]] was from [#place=[New York | Berlin]]."
+ " $name finds $place cold and wet in winter.";
let result = RiScript.evaluate(script);
console.log(result);
`
sh$ git clone https://github.com/dhowe/riscript.git
$ cd riscript
$ npm install
$ npm run build
$ npm test
`
If all goes well, you should see a list of successful tests and find the library built in 'dist'
Please make contributions via fork-and-pull - thanks!
About
* Author: Daniel C. Howe
* Tutorial: https://observablehq.com/@dhowe/riscript
* Github Repo: https://github.com/dhowe/riscript
* Issues: https://github.com/dhowe/riscript/issues
* Reference: https://rednoise.org/rita/reference
* RiTa Web: https://rednoise.org/rita
Quick Start
#### A simple browser sketch
Create a new file on your desktop called 'test.html' with the following lines, save and drag it into a browser:
`html
`#### An ESM browser sketch
Create a new file on your desktop called 'test.html' with the following lines, save and drag it into a browser:
`html
`#### With p5.js
Create a new file on your desktop called 'test.html' with the following lines,, save and drag it into a browser:
`html
`$ npm install riscript`javascript
let { RiScript } = require('riscript');let script = "[#name=[Jane | Bill]] was from [#place=[New York | Berlin | Shanghai]]."
+ " $name finds $place cold and wet in winter.";
let result = RiScript.evaluate(script);
console.log(result);
``
This project exists only because of the people who contribute. Thank you!
