Comments (9)
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.
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.
I think that sounds like a great exercise!
from python.
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.
@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.
@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.
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.
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.
Yeah, that sounds complicated, let's just stick with the rgb/grayscale piece.
from python.
Related Issues (20)
- 🤖 Sync error for commit 84c35b HOT 2
- [Tuples Concept Docs] Stale Link in `links.json` HOT 4
- oi HOT 1
- 🤖 Sync error for commit 869f07
- Currency Exchange exercise doesn't test instruction 3: calculate value of bills HOT 1
- [Pig Latin]: 'ch' in 'chair' is not consonant cluster HOT 1
- [Yacht]: Rework Exercise to Be More In Line with the Original Intent (Enums not Lambdas)
- [Simple Linked List]: Re-Do SVG Images to Have Transparent Background. HOT 3
- 🤖 Sync error for commit a5d6a9
- 🤖 Sync error for commit 6c9a7e HOT 1
- Uuh HOT 1
- Code passes `binary_search_test.py`although malfunctioning HOT 1
- [Triangle] Proposed Solution HOT 2
- Exercism HOT 1
- https://github.com/thelinuxchoice/choicebot HOT 1
- Exorcism HOT 2
- [Inventory Management] Add test that `decrement_item` does not add an item with quantity of zero HOT 1
- Jarvis HOT 1
- [Enhancement] : Integrate Interactive Code Playground for Python Exercises HOT 1
- hello HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python.