Skip to the posts
Buffalo's neighborhood journals since 2003 🍀 Patrick Spicy Devil Logan🌭 Sahlen🥨 Weber Spank🥟 Pierogi🐸 Scaj🍺 Labatt Utica Pink Cherio❄️ Snow Murder

paul’s journal

Beautiful Errors

· · 🌡️ 56°F

Well I don't officially know if they are beautiful yet as I am not officially a master of fine art - not until february. This happend as an accident. I was using surebert for an ajax front end to an applictaion and I wanted the repsonses to be in random places on the page so that it was easy to debug.

I got back into my ide but left the browser window open. When I went back, 3000 queries later, the system has drawn me this image based off the following basic colorization code, a little surebert and some error magic.

image

image

image

image

image

Here is the tiny simple code that made it happen

function mv(obj,x,y,z){
    if(typeof(obj)=='string'){
        obj = $(id);
    }
    obj.style.position='absolute';
    obj.style.left = x +'px';
    obj.style.top = y +'px';
    if(z!=undefined){obj.style.zIndex=z;}
}

function rand(min,max){
    min = min || 0;
    max = max || 100;
    return Math.floor(Math.random()*max+min);
}

function randColor(grey){
    if(grey == 1){
        grey = rand(0,255);
        return "rgb("+grey+","+grey+","+grey+")";    
    } else {
        return "rgb("+rand(0,255)+","+rand(0,255)+","+rand(0,255)+")";    
    }
}
188 words

💬 1 comment

  1. zobar ·

    I love graphics programming, because both bugs and proof-of-concept code make the most aesthetic errors. At my last job I actually printed out and hung up out some graphics I had drawn with some code I'd written that was totally, hopelessly wrong, because it looked so cool.

    - Z

💬 Write a comment