Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

17
  • \$\begingroup\$ If something is not clear in this question - write it in comments - I will edit it \$\endgroup\$ Commented Aug 7, 2022 at 22:23
  • 3
    \$\begingroup\$ Request for clarification: other answerers have interpreted "code necessary to draw the test case" as including the test code itself, as opposed to just the code necessary to run it (as is more usual on Code Golf). If this is your intention, then how much are we allowed to golf the test code? If I declare a=127, b=128, c=255 and so on it can save a few bytes, but also I can save bytes by replacing some of the calls to the putPixel function with others that achieve the same image output with fewer calls in total... and I'm sure you didn't intend to allow that. So where is the line? \$\endgroup\$ Commented Aug 8, 2022 at 10:38
  • 1
    \$\begingroup\$ It seems I can get my solution down to 307 bytes if hex strings are allowed; perhaps @KamilKiełczewski can clarify? \$\endgroup\$ Commented Aug 8, 2022 at 12:31
  • 1
    \$\begingroup\$ Indeed, it's not trivial, and I don't blame you for not wanting to specify your challenge in such detail. This is why Code Golf challenges normally don't count the size of the test code towards the score... \$\endgroup\$ Commented Aug 8, 2022 at 12:54
  • 2
    \$\begingroup\$ Regarding parameters, @kaya3: I believe it's OK to have as many/as few parameters as desired when defining the function as long as you can pass six (or more) values separately. It's OK if you pass a single array if it contains the three separate values for R, G and B. No need to restrict input that much. Where's the (more than technical) difference if you write p(x,y,[R,G,B],A) instead of p(x,y,R,G,B,A) or p(xxyyRRGGBBaa)? You should, however, imho not mix multiple values into one parameter, e.g. 16777215 for FFFFFF meaning "white" since you cannot change the inputs independently in this case. \$\endgroup\$ Commented Aug 8, 2022 at 13:56