5
Matlab has a useful command for visualizing data: plot
. It draws data points using "markers" in 2-D space, connecting them with lines; however, for this challenge, let's ignore the lines and use only markers. In fact, only one marker.
Input: one of Matlab's marker symbols: .
o
x
+
*
s
d
v
^
<
>
p
h
Output: corresponding image for that marker, which is one of the following 13 icons:
To make it clearer, here are the same icons enlarged, so the pixels can be easily seen:
Take the input as a string, a
char
, an integer ASCII code, or anything equivalentProduce the output by displaying the image, returning it as a function's return value, saving it to a file, etc
The image should have pixels of two different colours in it. I used blue on white, because this is what Matlab uses by default, but any other colour scheme is OK, e.g. white on black.
The image can have padding of background colour of any size
The pixels can be enlarged by any integer ratio, e.g. instead of the original 11-by-9 image for the triangle, you can output a 110-by-72 image, in which 10-by-8 blocks represent the original pixels
- As a corollary of the above, you can output text with glyphs like
█
instead of an image, if you can print this text properly (i.e. without gaps between glyphs) on the same system which runs the code
- As a corollary of the above, you can output text with glyphs like
For quick reference, here are the bitmaps for each input:
.
0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 1 1 1 1 1 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0
o
0 0 0 0 1 1 1 0 0 0 0 0 0 1 1 0 0 0 1 1 0 0 0 0 1 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 1 0 0 0 0 1 1 0 0 0 1 1 0 0 0 0 0 0 1 1 1 0 0 0 0
x
0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0
+
0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0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exists in these bitmaps is optional. So e.g. for the .
input, a 5x5 image would be sufficient.
Possibly add [tag:compression]? – Jonathan Frech – 2018-11-11T20:27:58.983
Can output be unpad? (5*5 for
.
) – l4m2 – 2018-11-12T00:29:58.680Yes. Thought it would be obvious; will clarify. – anatolyg – 2018-11-12T00:31:49.160
2Why is the star so horribly mutilated? ergh – Jo King – 2018-11-12T00:55:51.780
1I am more fascinated by the fact that it's still recognizable when the pixels are small enough! – anatolyg – 2018-11-12T01:00:05.633
1
@JonathanFrech Rather than compression, I think [tag:kolmogorov-complexity] is more appropriate due to the limited number of potential inputs and direct mapping of inputs to outputs (similar to this challenge).
– None – 2018-11-13T15:00:25.310@Rogem I agree that [tag:kolmogorov-complexity] could fit, however such challenges generally are about constant output and only seldom allow input of any kind. Therefore I suggested [tag:compression]. – Jonathan Frech – 2018-11-13T22:18:21.697