GithubHelp home page GithubHelp logo

Voting enhancements about battlefox HOT 2 CLOSED

Razer2015 avatar Razer2015 commented on September 22, 2024
Voting enhancements

from battlefox.

Comments (2)

Kiiyya avatar Kiiyya commented on September 22, 2024

The way to do this would be to add a parse_map function on MapPool which handles the numbers etc, since it stores the maps in a vector a not a hash map. Though, maybe the better would be to convert MapPool to use a hash map internally, and instead store the map vote numbers in the Extra (generic param, currently ()).

Or just get rid of MapPool entirely and add traits for HashMap<MapInPool>? Maybe while I'm at it, remove MapInPool too lol, and replace it with traits too. Hmm...

from battlefox.

Kiiyya avatar Kiiyya commented on September 22, 2024

Length consideration:

  • len("Vote with numbers or names:\n") = 24
  • len(tab-padded map name) = 11
  • One option: len("{}\t {}", number, tab-padded map name) = 3 + 11 = 14
  • One line: \t + (3 options) + \n = 2 + 3 * 14 = 44

So in total, for at most 6 options, you get an upper bound of 24 + 44 * 2 = 112 characters, which is less than 127 characters, so it'll work.

...And that's about as much as I have energy for, for the whole week, likely.

from battlefox.

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.