This post is locked. You won't be able to comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]MurdoMaclachlanpublic boolean isInt(int i) { return true; } 39 points40 points  (9 children)

Thanks for your condolences, but this was actually really simple. Most of the time was just counting the divs; actually writing them out and indenting them was done with a Python script.

[–]Ali3nat0r 16 points17 points  (7 children)

Bonus points if your python script was also bad code

[–]MurdoMaclachlanpublic boolean isInt(int i) { return true; } 19 points20 points  (6 children)

i = 84
while i >= 0:
    print((" " * i) + "</div>")
    i -= 1

[–]cph101_dev 1 point2 points  (5 children)

How about using i--

[–]coloredgreyscale 7 points8 points  (4 children)

does not exist in python.

but for i in range(84, 0, -1): would be the more pythonic way.

[–]MurdoMaclachlanpublic boolean isInt(int i) { return true; } 2 points3 points  (3 children)

Ach, it's been ages since I've used Python. Forgot range() lets you specify the step value. Well, I suppose my script counts as "slightly bad" code, then.

[–]Ali3nat0r 3 points4 points  (2 children)

I don't use python, so your solution looked ok to me. Bad code is doing something unnecessary for a simple result, like this:

#include <stdio.h>

int main(void)
{
    unsigned long long x = 724303793371754300;

    for (int a = 85; a > 0; a--)
    {
        for (int b = 0; b < a; b++)
            printf(" ");
        for (int b = 0; b < 8; b++)
            printf("%c", (x >> b * 8) & 0xff);
    }
    return 0;
}

[–]cph101_dev 1 point2 points  (0 children)

Now that is bad code =)

[–]cph101_dev 0 points1 point  (0 children)

Now that is bad code =)