hypercubed's notebooks

  • RunKit + npm: smykowski - /hypercubed/runkit-npm-smykowski
    Last edited 7 years ago - from: https://npm.runkit.com/smykowski
    const { Smykowski, defaultEncoders, defaultDecoders, classSerializer } = require("smykowski@1.2.0"); class Person { constructor(first, last) { this.first = first; this.last = last; } getFullname() { return this.first + ' ' + this.last; } } class Employee extends Person { constructor(first, last) { super(first, last); this.id = NaN; } } const ajson = new Smykowski() .use(classSerializer, { Person, Employee }) .use(defaultEncoders) .use(defaultDecoders);
  • How many digits does 125¹⁰⁰ have? - /hypercubed/how-many-digits-does-125-have
    Last edited 7 years ago
    const { Stack } = require('@hypercubed/f-flat@0.0.7'); const f = new Stack(); f.eval(` math: rcl use core: rcl use 300 set-precision `).stack;
  • F-Flat: Quadratic Equation - /hypercubed/f-flat-quadratic-equation
    Last edited 7 years ago
    const { Stack } = require('@hypercubed/f-flat@0.0.6'); const f = new Stack(); f.eval(` core: rcl use math: rcl use types: rcl use shuffle: rcl use `).stack;
  • “Objects” in f-flat - /hypercubed/objects-in-f-flat
    Last edited 7 years ago
    const { Stack } = require('@hypercubed/f-flat@0.0.6'); const f = new Stack(); f.eval(` core: rcl use shuffle: rcl use animal: { name: 'unknown', speak: [ 'grunt' ] : } ; dog: animal { speak: [ 'bow-wow' ] : } << ; human: animal { speak: [ name: @ 'My name is ' swap + ] : } << ; `).stack;
  • F-Flat: Fizz buzz - /hypercubed/f-flat-fizz-buzz
    Last edited 7 years ago
    const { Stack } = require('@hypercubed/f-flat@0.0.6'); const f = new Stack(); f.eval(` core: rcl use types: rcl use math: rcl use xxs: [ [ first ] [ rest ] bi ] ;; // This is an alternative to pattern matching // This, and pattern matching, will be coming soon /** * Calls the second quotation in the first pair whose first quotation yields a true value. */ cond: [ dup length 0 > [ xxs slip slipd [ cond ] >> branch ] when ] ; `).stack;
  • F-Flat: 20 Happy Numbers - /hypercubed/f-flat-happy
    Last edited 7 years ago
    const { Stack } = require('@hypercubed/f-flat@0.0.6'); const f = new Stack(); f.eval(` core: rcl use types: rcl use math: rcl use xxs: [ [ first ] [ rest ] bi ] ;; // This is an alternative to pattern matching // This, and pattern matching, will be coming soon /** * Calls the second quotation in the first pair whose first quotation yields a true value. */ cond: [ dup length 0 > [ xxs slip slipd [ cond ] >> branch ] when ] ; `).stack;
  • F-Flat: Quicksort - /hypercubed/f-flat-quicksort
    Last edited 7 years ago
    const { Stack } = require('@hypercubed/f-flat@0.0.6'); const f = new Stack(); f.eval(` core: rcl use types: rcl use shuffle: rcl use `).stack;
  • 73939133 - /hypercubed/73939133
    Last edited 7 years ago
    const { Stack } = require('@hypercubed/f-flat'); const f = new Stack(); f.eval(` math: rcl use core: rcl use `).stack;
  • Hyperfactorial - /hypercubed/hyperfactorial
    Last edited 7 years ago
    const { Stack } = require('@hypercubed/f-flat'); const f = new Stack(); f.eval(` math: rcl use core: rcl use `).stack;
  • Numerical differentiation - /hypercubed/numerical-differentiation
    Last edited 7 years ago
    const { Stack } = require('@hypercubed/f-flat'); const f = new Stack(); f.eval(` math: rcl use core: rcl use shuffle: rcl use 200 set-precision nd: [ dup [ over + rot bi@ - ] dip / ] ; // forward difference approximation to the derivative `).stack;