GithubHelp home page GithubHelp logo

fountain-expts's Introduction

Fountain-exp'ts

Fountain CSL grammar experiments.

This was probably the wrong part of the Fountain design document to be inspired by:

We can thread an explicit pseudo-random number generator through a Fountain grammar currently, by passing a parameter up and down through the productions, calling a certain production with this parameter to advance the pseudorandom generation state, and selecting on this state in every relevant alternation operation.

However, this is tedious.

but prng.fountain is my attempt at implementing a Xorshift PRNG inspired by this Z80 implementation.

fountain.exe generate prng.fountain seed=34
Seed   : Coin toss
0x3B2A : Heads
0xD37D : Tails
0xA6CB : Tails
0xE92A : Tails
0x6814 : Heads
0x4725 : Heads
0x1ACF : Heads
0x0C71 : Heads
0xDFEB : Tails
0x547E : Heads
0x204B : Heads
0xCCC9 : Tails
0xB51D : Tails
0xBB80 : Tails
0xC6BD : Tails
0xE971 : Tails
0x88D9 : Tails
...

throwing-prng.fountain uses the PRNG to generate a ball throwing scenario where characters may drop the ball "randomly" given a start seed. The threshold is set within the production constraints with <. thres = nnnnn .>.

fountain.exe generate throwing-prng.fountain seed=34
Anise has the ball.
Anise throws the ball to Blaschko. 
Blaschko throws the ball to Anise. 
Anise throws the ball to Blaschko. 
    Oh no! Blaschko dropped the ball!
Blaschko fetches the ball and throws it back to Anise. 
Anise throws the ball to Blaschko. 
Blaschko throws the ball to Anise. 
Anise throws the ball to Blaschko. 
Blaschko throws the ball to Anise. 
Anise throws the ball to Blaschko. 
Blaschko throws the ball to Anise. 
Anise throws the ball to Blaschko. 
Blaschko throws the ball to Anise. 
Anise throws the ball to Blaschko. 
Blaschko throws the ball to Anise. 
Anise throws the ball to Blaschko. 
    Oh no! Blaschko dropped the ball!
Blaschko fetches the ball and throws it back to Anise. 
Anise throws the ball to Blaschko. 
Blaschko throws the ball to Anise. 
Anise throws the ball to Blaschko. 
Blaschko throws the ball to Anise. 
Anise throws the ball to Blaschko. 
Blaschko throws the ball to Anise. 
Anise throws the ball to Blaschko. 
Blaschko throws the ball to Anise. 
Anise throws the ball to Blaschko. 
Blaschko throws the ball to Anise. 
Anise throws the ball to Blaschko. 
Blaschko throws the ball to Anise. 
Anise throws the ball to Blaschko. 
Blaschko throws the ball to Anise. 
Anise throws the ball to Blaschko. 
Blaschko throws the ball to Anise. 
Anise throws the ball to Blaschko. 
    Oh no! Blaschko dropped the ball!
Blaschko fetches the ball and throws it back to Anise. 
Anise throws the ball to Blaschko. 
Blaschko throws the ball to Anise. 
Anise throws the ball to Blaschko. 
Blaschko throws the ball to Anise. 
Anise throws the ball to Blaschko. 
    Oh no! Blaschko dropped the ball!
Blaschko fetches the ball and throws it back to Anise. 
Anise throws the ball to Blaschko. 
Blaschko throws the ball to Anise. 
Anise throws the ball to Blaschko. 
Blaschko throws the ball to Anise. 
Anise throws the ball to Blaschko. 
Blaschko throws the ball to Anise. 
Anise throws the ball to Blaschko. 
Blaschko throws the ball to Anise. 
Anise throws the ball to Blaschko. 
Blaschko throws the ball to Anise. 
Anise throws the ball to Blaschko. 

Tested using Fountain 0.4. These examples may very well break in future. I haven't really thought through all the implications of this, but parsing this output to verify the original seeds will be pretty neat, which seems like it is at least a theoretical possibility from Fountain's design. It's highly likely that I am abusing Fountain to use it more like a programming language than intended...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.