3
\$\begingroup\$

How would we score changing the colors of graphs in Desmos in [graphical-output] challenges with color-sensitive output? Currently, selecting the color in the menu costs no bytes as no characters are used to do it. This has raised some concerns about being "unfair" when competing with languages where the color is defined in the text.

Should there be a penalty for setting the color of a graph? If so, what should the penalty be?

\$\endgroup\$
2
  • 2
    \$\begingroup\$ I think this is putting the cart before the horse. The first question has to be whether answers in Desmos are valid at all given that it appears to be neither a programming language nor capable of saving source code. \$\endgroup\$ Apr 23, 2019 at 16:27
  • 1
    \$\begingroup\$ @PeterTaylor Desmos answers are valid \$\endgroup\$ Apr 23, 2019 at 16:38

3 Answers 3

4
\$\begingroup\$

Setting the color is not part of the language

As defined here, there is no way to encode the color. This means that the color of the graph is not part of the language, similar to how setting the default font color in my terminal settings isn't part of bash.

If color is required as part of the answer, then there must be a way to encode this color in a way that the website understands. For example, if the site is able to save/load the graph (including colors) from the browser cache, you can use that as your code (and you would measure the byte count of the saved data).

\$\endgroup\$
3
  • \$\begingroup\$ Looking at the browser console, it appears that the hex colors are hardcoded into the html as button attributes in the form #rrggbb. \$\endgroup\$ Apr 23, 2019 at 17:16
  • \$\begingroup\$ @BenjaminUrquhart I took a brief look at the website, and it looks like there is saving functionality. If you are able to save the color, then it's definitely possible. It's simply a matter of figuring out how it is saving it, and then measuring the bytes of the saved graph. \$\endgroup\$ Apr 23, 2019 at 19:30
  • 2
    \$\begingroup\$ One other side note: I noticed that the site automatically selects colors. If you are able to order the code such that the automatically selected colors are the right ones, then that would work as well. \$\endgroup\$ Apr 23, 2019 at 19:42
0
\$\begingroup\$

Color should be the minimum number of bits needed

If no colors are defined in the code, that would be 6 options, minimally represented in 3 bits. If more than two and at most 10 colors are defined. then each expression with a color chosen would have a penalty of 4 bits. With more than 10 colors, and at most 26 colors, the penalty would be 5 bits, and so on.

\$\endgroup\$
-1
\$\begingroup\$

Penalty only if output is colour specific, with penalty at 3 bytes.

Colours are often represented with RGB values and hex values. These would take 3 bytes to store the colour data.

\$\endgroup\$
1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .