Seeing as I am writing this at 3am I really should write about something. It would appear that I have written a very good introduction to a post about colouring in, which is particularly fortuitous as I have a very good program to write about that does exactly that.
What I have done is altered my last program so that instead of using a square box it uses any user inputted shape. To input a shape you first need to create a boundary of black cells, ensuring that it is closed, i.e. every black cell is touching at least two others horizontally, vertically or diagonally. You then need to set a spawn point by entering any characters in any one cell in the centre of your shape. In this rendition every ant is spawned at one cell for simplicity. So suppose I entered this:
A heart turns out to be an easy bit image. |
Here the '<3' is my spawn point. If I then run my code with one ant it produces this:
The only thing cuter would be a kitten. I am not doing a kitten. |
I am going to admit that it took me several runs to get this because the colours are still on random, but my romantic side refused to have anything put a red heart. Alright, pink. I'm not quite romantic enough to spend 30 minutes of non-sleeping for my computer to happen to pick brilliant crimson out of the sixteen million possible colours allowed by my code.
31,
mathmo