Giter VIP home page Giter VIP logo

Comments (4)

phikal avatar phikal commented on May 30, 2024

(Sorry for taking so long to respond, my repository notifications were apparently disabled)

This is the section of the code that calculates the score:

/** Calculuate score of new solution, based on task, game and level */

There is nothing to understand, I just experimented with a few constants and functions to get something approximating a sensible score. What actually has to be done, is to parse the regular expression into a tree, then compare the size of the regular expression to the smallest expression (that should also be calculated beforehand), and using the difference to determine how many points you get for each problem.

from regex.

ameenross avatar ameenross commented on May 30, 2024

the smallest expression (that should also be calculated beforehand)

That seems like a tough job in and of itself.

from regex.

ameenross avatar ameenross commented on May 30, 2024

So what I understand from the code is this:

(charactersSaved / 2 + 1) * (gameDependentConstant + 3 * regexValue)

Where regexvalue is calculated by counting meta characters, and a \ counts for 2. So using meta characters positively influences the score, is that correct?

from regex.

phikal avatar phikal commented on May 30, 2024

That seems like a tough job in and of itself.

The algorithms might be non-trivial, but is would essentially build a random regular expression depending on the difficulty, check if can be minimised, then use this to generate a number of words that are in and outside of the described language (again, the number and length depends on the level).

from regex.

Related Issues (20)

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.