Giter Site home page Giter Site logo

sim's Introduction

Made by Nicky Case

Dedicated to the public domain with Creative Commons Zero! I'm giving away all my art/code/words, so that you teachers, scientists, hobbyists, activists, and emoji-lovers can use them however you like! This is for you. ๐Ÿ’œ

How To Run This On Your Own Computertron

Yeah basically just download this github repository, and host it on some local server. I use the minimalist http-server, but you can also use MAMP. (Simulating The World is just a bunch of static files, but it needs to be on a server because of some weird browser security issues with XMLHttpRequests)

Saving your own sims locally:

  1. Get it running on your own computertron (see above). For the sake of this example, let's assume it's running on http://localhost:8080/. (which it will by default, if you use http-server)
  2. Go to http://localhost:8080/, and make your own sim!
  3. Click "export model". Your simulation's data should pop up in a new tab.
  4. Save it locally to [your local folder]/models, as [your sim name].json. (NOTE: the ".json" extension is important!)
  5. Finally, to see your own sim in action, go to http://localhost:8080/?s=[your sim name]! Voilร ! And you can keep editing and exporting from there, just copy-paste the new data to [your sim name].json.

Other Peeps' Stuff I Used

They're all open source!

Code Stuff:

  • MinPubSub - A tiny publish/subscribe library.
  • Perfect Scrollbar - Custom scrollbars. Mostly because Mac OS X Lion is silly and hides all the scrollbars because 'minimalism'.
  • requestAnimationFrame shim - A requestAnimationFrame polyfill.
  • reqwest - A tiny XMLHttpRequest library.
  • Platform.js - To test browser/OS, because there is no good emoji feature detection arrrgghhhhhhhh

Font Stuff:

  • Sniglet - For the title splash.
  • OpenSansEmoji - Fallback font if your browser doesn't support emoji.

A Narcisstic List of Press This Thing Got

sim's People

Contributors

antfu avatar ncase avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

sim's Issues

Add note that "world-state isn't saved" to the Save feature to avoid frustration

We tried creating a Gosper glider gun at https://ncase.me/sim/?s=conway and then saving it to share with others.
It seems that the "Save" feature just saves the Rules, and then randomly populates the grid per the World settings.

P.s. Thanks as ever for the great web-tool!

Moving Things have inconsistent behavior when checking for neighbors

Example simulation to demonstrate the issue

If two Things have rules to turn into another Thing when they are next to each other and one of the Things is moving, inconsistent behavior may occur: the moving Thing may not transform.
This behavior holds for two moving Things: one Thing may transform, and the other may not.

When Thing 1 moves next to Thing 2, there is a chance that Thing 2 will turn into Transformed Thing 2 between frames, as Thing 1 moves into the spot next to Thing 2. Thus, on the frame where Thing 1 and Thing 2 would actually be next to each other, Thing 2 may have already transformed, and thus Thing 1 will not transform.

This issue seems to occur at any speed setting.

Allow for boolean operators

I don't know if I just oversaw it, but is there any possibility to add boolean operators to the if statements?

For example, in the beach example (https://ncase.me/sim/?s=beach), if I want to add deep water that spawns when all 8 neighbours are water, I'd need something like if exactly 8 neighbours are water OR deep_water. I guess you could work your way around the need for this OR here, but it would be convenient to have.

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.