Giter Club home page Giter Club logo

chombot's People

Contributors

dependabot[bot] avatar iipin avatar m4tx avatar phoe avatar seqre avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

chombot's Issues

Simplify hand format parser

Currently !hand command scans hand description from left to right, which complicates things a bit – tile suite is specified after a sequence of tiles, so we need to either remember tiles with unspecified suite (which is the current solution) or do a forward lookup first. Parsing from right to left should simplify the whole process.

Cache tile images in PNGHandRenderer

Currently commands.hand.PNGHandRenderer, when asked to load an image file, reloads it from disk every time, which is probably not a very good thing – there are not that many tiles to begin with and some of them are heavily reused (e.g. Front.png). It would be nice if it could read each tile at most once – either eagerly (read all tiles at startup) or lazily (read from disk when necessary and store result for later).

Limit number of tiles to render

The !hand command does not have input size limit, so it is possible to send a big request which would painfully slow down the bot, e.g. long sequence of 1s followed by m repeated many times. Limiting total number of rendered tiles to, say, 30 would (at least partially) solve this problem.

Better handling of parser errors

Currently the hand format parser simply sends error message when given wrong hand description. It would be nicer if it had special tile (e.g. Blank.png, see tile repository) that would be used after encountering unexpected symbol. It would make the process of pinpointing the mistake much simpler.

Bake `MESSAGE_PREFIX` into TournamentsWatcher

Is there a specific reason for this text to be provided by the user? It seems like the structure is being used for one reason only anyway, so why not specify it as const inside it?
Originally posted by @seqre in #193 (comment)

Indeed, that doesn't sound like a very bad idea. Perhaps I wanted this to be customizable by the users, but I don't think it makes much sense. Anyway, this is out of scope of this PR, but will fix that in one of the next ones.
Originally posted by @m4tx in #193 (comment)

!chombo list should not mention everyone

!chombo list currently mentions each user that has ever received a chombo. We should get the nickname for each user ID and put it in the message instead to avoid making people angry.

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.