niina.amniisia » bits, pieces and photos from sydney, australia and elsewhere

experiments (Saturday May 24th, 2003 - 17:15)

category: mmhuh?

i had a silly idea last night that i needed a new background on my desktop and that i wanted a colourful grid. ‘hey, i can program that!’ i think to myself so i program a random colour and table generator and it’s done.

‘but what if i want to make a new one tomorrow with different sized squares?’… so i add a little form with which i can manipulate the square sizes and the number of squares across and down.

i was falling asleep and the colour grids swam infront of my eyes and i realised something was missing. after a little more thought i knew that i’d not seen many grey-ish colours in my grids, each regeneration had been really colourful (which is what i had wanted, but that’s beside the point).

‘probability!’

the colours were generated as strings of six random characters from 0-9 or a-f (eg. aebf56).. true grey characters are in the format of aeaeae or 0f0f0f – two characters repeated. the probability of randomly generating a string in such a pattern was minute.

so i changed a couple of lines in my code and made one that just spat out grey squares.

with a little modifications so as not to overload my server, i’ve added a little experiments section to this site which i’ll make prettier soon.. in the mean time the colour and grey “tablecloths” are in there so if for some reason you feel like generating some random coloured squares, you know where to go!

Comments are closed.