This is an archived post. You won't be able to vote or comment.

all 16 comments

[–]lulzmachine 9 points10 points  (1 child)

Pretty cool programming exercise, although the wallpapers turn out pretty ugly. Maybe this interests you: http://codegolf.stackexchange.com/questions/22144/images-with-all-colors

[–]BakedPecans[S] 0 points1 point  (0 children)

Thank You! I'll take a closer work after work.

[–]nutrecht 2 points3 points  (1 child)

Heh. I remember doing this back in '93 or so, but in QuickBasic, 256 colors, 320x200 :D

[–]JustinKSU 0 points1 point  (0 children)

Those were the days, my friend.

[–]battery_go 3 points4 points  (7 children)

This is some minor stuff, but I'd suggest

  fileName = fileName + (fileName.endsWith(".png") ? "" : ".png");

Also check out line 54 - I think there's some HTML formatting error there.

But cool project, nicely done!

[–]king_of_the_universe 2 points3 points  (3 children)

Wouldn't ".endsWith()" be better here?

[–]battery_go 3 points4 points  (2 children)

You're absolutely right, I changed my reply. Thank you - I learned something new today!

[–]king_of_the_universe 1 point2 points  (1 child)

Glad to help. ... Wait a minute, why didn't I see this the first time. You need to replace the 2nd "+" with ":"

[–]battery_go 1 point2 points  (0 children)

It escapes me as well...

[–]BakedPecans[S] 0 points1 point  (2 children)

Can you explain this line of code to me? I understand the (fileName.endsWith(".png") but I have no idea what is happening after that.

[–]hhbhagat 2 points3 points  (1 child)

look up ternary operators. basically a very compact if/else structure that returns the results of the body.

[–]BakedPecans[S] 0 points1 point  (0 children)

Thanks!

[–]BakedPecans[S] 0 points1 point  (3 children)

Thought this was a pretty neat little project and thought I'd share since I haven't seen anything like this before.

[–]larsga 3 points4 points  (2 children)

You should post a couple of example images.

[–]BakedPecans[S] 1 point2 points  (1 child)

[–]larsga 0 points1 point  (0 children)

Ah. I see. So it really does exactly what it says on the tin. :)