My project is not acting right. I have comments everywhere to explain what’s happening and how it should work, so can you please help?
What is it supposed to be doing? (Or where are the comments?)
It should convert a string (something like: “000 034 142 000 | 111 222 333 444” (it auto converts that to “000034142000|111222333444”)) to an image. It then changes the 3 digit numbers that range from 0 - 5, to an rgb color (for 012 345 | 543 210 it would act as rgb rgb newline rgb rgb) so that 0 is transparent, and 1 - 5 is dark to light (1 darkest, 5 lightest). A | signifies to go to the next row of pixels. For 123123|123123|123|123543010, it would be a 3x4 image (technically 9x12)). One rgb pixel is a 3x3, one column of r, one column of g, one column of b. I named the format Hex6.
Ok I see what you’re trying to do and where it went wrong. First of all, you’ll need to fix the weird row stacking issue, which is caused by the next row being only shifted down by one instead of 3:
Then you have an issue where your colors are all messed up and are alternating red and green. This is because that “num” variable can never actually be “2”. This is because as soon as it becomes 2 it activates the IF statement under it and becomes 0 again. This is an easy fix, just make the IF statement check for a 3 instead of a 2:
Then lastly, all the blues are green, and that’s because you haven’t changed those +5s to +10s:
And look at that, everything works now!
:)
It works! it would definitely look better on a bigger display, like the default screen dimensions times 3. (360x480)