Comment

Comment by sharkbrainguy

Here's javascript, the other languages are left as an exercise.

    function Kitten(width, height, color) {
        var img, g, w, h;

        w = parseInt(width,  10);
        h = parseInt(height, 10);
        g = color ? "" : "g/";
        img = document.createElement('img');
        img.src = "http://placekitten.com/" + g + w + "/" + h;
        img.width = w;
        img.height = h;

        return img;
    };
parent sharkbrainguy 15 years ago

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton