Comments (5)
@Kiborgik Could you provide the code you use to call the function generate
?
from wavefunctioncollapse.
@Kiborgik I've looked further into it, and the error must come from your call. The argument you pass to the generate
function, if any, must be a function acting as a random number generator (see doc). If the argument is undefined / null / falsey, it defaults to Math.random
, so the only way to trigger this error is by passing an argument which is neither a function nor falsey. I'm guessing you probably have something along the lines of model.generate(Math.random())
where it should actually be model.generate(Math.random)
.
Let me know if this helps fixing your issue.
from wavefunctioncollapse.
Hello, im using code from your example. finished = model.generate(lcg("test"));
Maybe problem with my implementation of lcg(). Thank you for answer.
from wavefunctioncollapse.
@Kiborgik Probably. In my case lcg(...)
returns a function which act as a random number generator (a linear congruential generator to be precise). If you don't need to be able to have reproducible results, you can pass Math.random
as argument to the generate
function otherwise you could look into using the compute-lcg or the seedrandom packages.
from wavefunctioncollapse.
Anyway nice work from you. Take care
from wavefunctioncollapse.
Related Issues (6)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wavefunctioncollapse.