Git Product home page Git Product logo

wfc's Introduction

wfc

wave function collapse algorithm

Features

some features at a glance...

  • 2D & 3D graph
  • comfortable api to reshape and define constraints
  • generic user defined values
  • extendable classes if base behavior is not desired

Sample

Below is a sample which shows a possible use for wfc:

//easily define the shape (2D or 3D is supported)
LGraph := TGraph.Create.Reshape({width} 5, {height} 5, {depth} 1);

(*
  constraints are also very easy to add and the interface provide fluent setters.
  in this case A's & B's can be present in "any direction" on the graph (north, east, up, down, etc...)
*)
LGraph.AddValue('A')
  .NewRule(AllDirections, ['A', 'B']);

(*  
  but here, we constrain to just a few directions 
  A or B (N & S) of a "C"
*)
LGraph.AddValue('C')
  .NewRule([gdNorth, gdSouth], ['A', 'B']); 
  
(*
  when you're finished defining constraints and all of the
  possible values (states), then just run and the result can be 
  persisted or you can access the completed graph directly
*)
LGraph.Run();

How To Use

  1. download and install lazarus if you don't already have it (http://www.lazarus-ide.org)
  2. git clone this repo
    • some examples have submodule dependencies so if you want to clone this repo and bring in all of those do a git clone --recursive
    • if you already cloned you can update submodules with git submodule update --init --recursive
  3. open wfc_test.lpr and attempt to compile/run (F9 Key)
    • this project shows some basic usage of the library
    • also, by going to Toolbar -> Project\Project Options\Paths you can copy the other units text to include in your own project
  4. add .\src path to your project other units

Tip Jar

  • ๐Ÿ’ต BTC - bc1q55qh7xptfgkp087sfr5ppfkqe2jpaa59s8u2lz
  • ๐Ÿ’ถ LTC - LPbvTsFDZ6EdaLRhsvwbxcSfeUv1eZWGP6

wfc's People

Contributors

mr-highball avatar

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.