nrkn / hrm-tools

A collection of Human Resource Machine tools for the browser
2 stars 0 forks source link

Decide on web emulator features #1

Open nrkn opened 8 years ago

nrkn commented 8 years ago

Thoughts, ideas? @atesgoral @sixlettervariables

nrkn commented 8 years ago
nrkn commented 8 years ago
nrkn commented 8 years ago
sixlettervariables commented 8 years ago

I'm going to allow saving (a la JSFiddle) to a web service (via JAWS; Amazon's API Gateway + Lambda + S3), but my start will be with localstorage and it'll eventually persist to the web service. If we agree upon a "save" format for the source and it ends up as cheap as I think it'll be, I don't see a problem opening up that API for your app too.

I envision the save would look like:

{
  "source": "...",
  "level": { "type": "stock", "id": "1" },
  // "level": { "type": "custom", "def": { /*hrm-level*/ } }
  // reserved: top-level attributes starting with $
}
nrkn commented 8 years ago

Sounds good! Another option might be using an oauth popup to give permission to post/retrieve from a user's cloud account, like Dropbox et al?

http://stackoverflow.com/questions/32961230/upload-blob-to-dropbox-from-client-side-javascript

nrkn commented 8 years ago

Or to a gist?

https://github.com/k33g/gh3

sixlettervariables commented 8 years ago

A gist is an interesting idea, wonder if that is kosher with TOS?

Otherwise your feature list looks pretty good for the web emulator.

nrkn commented 8 years ago

I think it is? Untrusted saves to gists:

https://alexnisnevich.github.io/untrusted/

nrkn commented 8 years ago

Another option, use download attribute on an anchor to let them save a client generated json file, use HTML5 file api to load

nrkn commented 8 years ago

Not widely supported yet :/

http://caniuse.com/#search=download

nrkn commented 8 years ago

Implemented:

sixlettervariables commented 8 years ago

Looks good!

nrkn commented 8 years ago

Implemented:

atesgoral commented 8 years ago

Pull & run solution that's passed in through the URL. e.g.:

http://nrkn.github.io/hrm-tools/emulator/#/hs/1/fc41e23f26bc4b2c9008818a2af1578a

Can pull solution for level 1 from URL:

http://atesgoral.github.io/hrm-solutions/data/1/fc41e23f26bc4b2c9008818a2af1578a.json

Or to be able to pull directly from client via JSONP:

http://atesgoral.github.io/hrm-solutions/data/1/fc41e23f26bc4b2c9008818a2af1578a.js

An index of all solutions is also published at:

http://atesgoral.github.io/hrm-solutions/data/index.json (or JSONP: http://atesgoral.github.io/hrm-solutions/data/index.js)

nrkn commented 8 years ago

:+1:

hell yes

nrkn commented 8 years ago

@atesgoral you've probably thought of this but it occurs to me that you can probably make inbox-generator match the game data just by looking at the exploit solutions?

atesgoral commented 8 years ago

I've been looking at the inboxes generated by the game to come up with the inbox schema that is used by hrm-level-inbox-generator for each level. I may have made certain things unnecessarily dynamic (like allowing the inbox to be 4-6 characters instead of a fixed 5, etc.). I haven't had a chance to do a second round of comparisons of my schemas against the game. I think just looking at the game and exiting/reentering levels to get different inboxes is easier than deciphering exploit solution, if I understood your recommendation correctly.

nrkn commented 8 years ago

Implemented:

@atesgoral yep you're probably right about it being easier to just test against the game - that's what I did when I was trying to meet the pars!

Will be implementing load from hrm-solutions soon, and possibly also load from/save to gist?