GithubHelp home page GithubHelp logo

Reworking Allergies about python HOT 9 CLOSED

exercism avatar exercism commented on May 9, 2024
Reworking Allergies

from python.

Comments (9)

kytrinyx avatar kytrinyx commented on May 9, 2024

I originally made it to introduce the idea of bitmasks to some people I was mentoring. I think that it could probably benefit from an overhaul, and am absolutely open to suggestions.

from python.

Dog avatar Dog commented on May 9, 2024

What if we did bit masks through rgb and greyscale conversion? You take in a bunch of values simulating an image that you are converting. You could also take it a step farther by simulating compression in an image. (Think a lossy compression like jpg)

Languages could still do allergies via bitwise. I think a second exercise would make it easier to have freedom with Allergies or help solidify the concepts. The maintainers could then do as they see fit.

from python.

kytrinyx avatar kytrinyx commented on May 9, 2024

I think that sounds like a great exercise!

from python.

spthm avatar spthm commented on May 9, 2024

Hope you don't mind if I throw my 2c into this, before acting on #186.

+1 on the rgb/greyscale conversion. Actually, writing a code to convert 24-bit color to RGB (or hex) is the simplest example I can think of that both requires bit manipulation and isn't completely abstract, like e.g. a hash function.

If you wanted to make the Allergies test point toward using a bitfield, it might be an idea to write the numbers in the test file in binary form, i.e. 0b101 rather than 5.

In addition to problem(s) with the test, I think the readme could also be better. (Perhaps this is an issue for x-common?) It refers to 'scores' when they're really (bit-)flags. '(bit-)flags' may also be confusing, but I would not expect newcomers to see powers of two and think 'aha, bits!' Or, in fact, be anything other than confused by the 'scoring' system.

Obviously you don't want to give the game away, and figuring it out is part of the exercise. But I suspect this is currently a you-get-it-or-you-don't problem, so some more hints would not be detrimental to the learning value.

from python.

kytrinyx avatar kytrinyx commented on May 9, 2024

@spthm Yeah, you're probably right that the README could be improved (and that it's an issue for x-common) I'm just not sure in what way, without (as you say) giving the game away.

Writing the numbers in binary form in the test is an interesting suggestion.

from python.

Dog avatar Dog commented on May 9, 2024

@kytrinyx I can mock up an exercise. Would you like it focused on only color conversion, or should I also consider adding in a lossy compression component? Would I propose it via a pull request in x-common with the original test cases as a pull request in xpython?

@spthm I'll try to take a look into that by Friday. I think you are right about it being a you-get-it-or-you-don't problem. I know when reddit did their exercism team for python, a lot of people struggled with that problem as is.

from python.

kytrinyx avatar kytrinyx commented on May 9, 2024

Yeah, I'd love to see a suggestion for the exercise. Two PRs that reference each other would be great -- one in x-common where all the track maintainers can discuss the problem itself, and another with the test cases in python.

I don't know if the lossy compression component makes sense here--I think I just don't have a good picture of what it would look like with or without it.

from python.

Dog avatar Dog commented on May 9, 2024

I did some more thinking about it, and I think doing lossy compression is too much.

Initially I was thinking I could have people make a data structure for their image, and then implement a naive solution using that structure. The data structure would be composed of chunks for the full image. Each chunk represents a region of pixels with a color value. If a pixel is within a tolerance of its neighbor, you would average the pixels and combine them into a chunk.

from python.

kytrinyx avatar kytrinyx commented on May 9, 2024

Yeah, that sounds complicated, let's just stick with the rgb/grayscale piece.

from python.

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.