Back in second year of my undergraduate degree, we were asked in our MATLAB algorithms design class to write the smallest piece of code to produce the following:
After several attempts my final solution was to encode the face patterns in integers of a matrix. The command spy will plot a logical matrix. This is what I came up with.
In this "competition", only non-whitespace characters were counted. There were a few things like the function definition, hol and axis which were compulsory. I didn't beat the lecturer's solution but I did come up with a solution which I was very happy with.
Last night I was kind of bored and wanted something to do. I decided I'd try and make a random Voronoi diagram which fits in a Tweet.
I'm not quite as happy with this code compared to my Dice code, but I am still going to share it :)
Pretty short! And the output is pretty!