Giter Site home page Giter Site logo

esper.js's Introduction

CodeCombat

Build Status Coverage Status

CodeCombat is a multiplayer programming game for learning how to code. See the Archmage (coder) developer wiki for a dev setup guide, extensive documentation, and much more to get started hacking!

It's both a startup and a community project, completely open source under the MIT and Creative Commons licenses. Since it's a game (with really cool tech), it's really fun to hack on. Join us in teaching the world to code! Your contribution will go on to show millions of players how cool programming can be.

Whether you're novice or pro, the CodeCombat team is ready to help you implement your ideas. Reach out on our forum, our issue tracker, or our developer chat room on Slack, or see the docs for more on how to contribute.

MIT for the code, and CC-BY for the art and music. Please also sign the CodeCombat contributor license agreement so we can accept your pull requests. It is easy.

Note: the levels on codecombat.com are not open source.

API

We offer a partner API for SSO, user management, progress data, etc., with API docs here and SDKs here. You'll need client credentials, so get in touch with us if you have a use case for that.

For the very simplest case that can power some data integrations with your CodeCombat account, you can fetch https://codecombat.com/db/user/your-user-name-or-id to get some user progress stats. For example, Beeminder uses this API to help you commit to learning to code.

Nick Winter George Saines Scott Erickson Matt Lott Catherine Weresow Maka Gradin Rob Blanckaert Josh Callebaut Michael Schmatz Josh Lee Dan TDM Alex Cotsarelis Alex Crooks Alexandru Caciulescu Andreas Linn Andrew Witcher Axandre Oge Bang Honam Benjamin Stern Brad Dickason Carlos Maia Chloe Fan Dan Ristic Danny Whittaker David Liu David Pendray Deepak1556 Derek Wong Dominik Kundel Glen De Cauwsemaecker Ian Li Jeremy Arns Joachim Brehmer Jose Antonini Katharine Chan Ken Stanley Kevin Holland Laura Watiker Michael Heasell Michael Polyak Mischa Lewis-Norelle Nathan Gosset Oleg Ulyanicky Paul Buser Pavel Konstantynov Popey Gilbert Prabhsimran Baweja Rachel Xiang Rebecca Saines Robert Moreton Ronnie Cheng Ruben Vereecken Russ Fan Shiying Zheng Sébastien Moratinos Thanish Muhammed Tom Steinbrecher Yang Shun Tay Zach Martin

esper.js's People

Contributors

andrewjakubowicz avatar basicer avatar jongwookyi avatar nwinter avatar sderickson avatar smallst avatar ultcombo 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  avatar  avatar  avatar

Watchers

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

esper.js's Issues

Date

I wanted to add the native Date like in issue #6: addGlobal('Date',Date').

Usingnew Date works (new Date('December 25, 1995 23:15:30');) but methods aren't working ( Xmas95.getMonth()).

var Xmas95 = new Date('December 25, 1995 23:15:30'); // works
var month = Xmas95.getMonth(); // doesn't work

console.log(month);

Is there a way to expose the methods?

Installation failed on Windows 10

Hi, I have an issue during installing dependancies in CodeCombat project in master branch:
(Node version v6.12.3, npm 3.10.10)

Error `npm ERR! Windows_NT 10.0.16299 npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" npm ERR! node v6.12.3 npm ERR! npm v3.10.10 npm ERR! code ELIFECYCLE

npm ERR! [email protected] preinstall: node contrib/install-plugin-deps.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] preinstall script 'node contrib/install-plugin-deps.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the esper.js package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node contrib/install-plugin-deps.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs esper.js
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls esper.js
npm ERR! There is likely additional logging output above.`

Could you please help me?
@basicer

new Date

I don`t know, how expose native Date to tested code.
Trying addGlobalFx('Date',Date) results in 'TypeError: function is not a constructor(…)'
Uncomment scope.set('Date', this.fromNative(Date)) results 'Uncaught TypeError: Tried to load an unsafe native value into the interperter:function / function Date() { [native code] }'

Any overwork ?

Support ES6 block scoping

(Related to #15 and #16)

Is it easy to add support for ES6 block scoping for let and const?

It's somewhat meaningless (and even confusing) to have let and const but no block scoping for them, because it's the main difference between them and var.

The documentation is down

If I try to access the documentation page I get an 502 Bad Gateway Error. The same happens for the demo.

Cannot load core-js

core-js is a popular ES6 polyfill:
https://github.com/zloirock/core-js

For example, it's used in Babel:
https://babeljs.io/docs/en/babel-preset-env

I've used rollup:
https://github.com/ngocdaothanh/one-core-js

To merge all ES6 polyfill files:
https://github.com/zloirock/core-js/blob/master/packages/core-js/es/index.js

Into this one file:
https://github.com/ngocdaothanh/one-core-js/blob/master/es6polyfills.js

When esper.js loads that file, there's error:
Cant index propertyIsEnumerable of undefined

The error is thrown from here:
https://github.com/codecombat/esper.js/blob/master/src/Evaluator.js#L406

Would you please investigate and fix the error?

string[index] doesn't work correctly

See the line console.log(string, i, char) below in the program to check if parentheses are balanced:

function check(string) {
  let count = 0

  for (let i = 0; i < string.length; i++) {
    const char = string[i]
    console.log(string, i, char)

    if (char === '(')
      count++
    else if (char === ')')
      count--

    console.log(count)
    if (count < 0) return false
  }

  return count === 0
}

console.log(check('()(()())'))

Expected output:

()(()()) 0 (
()(()()) 1 )
()(()()) 2 (
...

Actual output:

()(()()) 0 (
()(()()) 1 (
()(()()) 2 (
...

It seems that in this program string[index] always returns the first character.

Cannot catch load error

With the latest master code, the log below is not printed:

var engine = esper({});
try {
  engine.load('invalid code');
} catch (e) {
  console.log('Error: ' + e);
}

Bug in new demo

const x = 'a';

const y = () => {
    const x = 'b';
    
    console.log(x);
}

y();

Output is right in the demo online ('b'), but when I build the code, the demo output is 'a'.

Thought I would let you know.

Array pop does not change state

Array.pop is no longer updating the state in the latest build.

Current build (28 September 2017, version ad69d01):

var testArray = esper.eval("var testArray = ['one', 'two', 'three']; testArray.pop(); testArray");
console.log('testArray', testArray); //  ['one', 'two', 'three']

The current version doesn't update the testArray variable after pop.

Previous build on Esper.js demo website (23 Aug 2017, unversioned):

var testArray = esper.eval("var testArray = ['one', 'two', 'three']; testArray.pop(); testArray");
console.log('testArray', testArray); //  ['one', 'two']

The previous build has the correct behavior.

Redeclaration of const should throw SyntaxError

You can do attempt to change a const variable without any error. For example, it should throw an error SyntaxError: redeclaration of const y instead of silently not reassigning y in this code

const y = 2;
y = 4;
print(y); // prints 2

Tuple in Python allows reassignment

I'm not sure if this is the intended behavior in Esper.js but if you use the Python language a tuple can be reassigned.

var engine = new esper.Engine({language: 'python'})
console.log(engine.evalSync("x = ('a', 'b'); x[0] = 'reassigned'; x;"))

If you use a Python interpreter instead of Esper.js an error is raised: TypeError: 'tuple' object does not support item assignment. Interestingly using Skulpt directly raises the error correctly.

run() stops after FutureValue resolves

Hi there,
it seems like esper.js stops interpretation once it reaches a FutureValue.
When the promise resolves, run terminates.

The following code prints 42 onto the console instead of 43, and further testing revealed that anything called after test() won't be executed anymore.

var engine = esper({

});

function test() {
    return esper.FutureValue.make(
        new Promise((resolve) => {
            setTimeout(resolve, 1000);
        }).then(() => 42)
    );
}

engine.addGlobalFx('test',
    test
);
engine.load('test(); 43;');

engine.run().then((result: any) => {
    console.log(result.toNative());
});

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.