Monday, August 3, 2015

A New Challenge: Character Count Challenge

So, as anyone who has read this blog would probably have noticed, I haven't been solving many problems recently. I actually have written up solutions to a few problems beyond what is on this blog, but I haven't been able to port them to more esoteric languages. I think I have realized that at around the point where I am (a bit past 100), the problems are starting to actually be somewhat challenging from a mathematical / programming standpoint, and trying to squeeze things into different languages is just more effort than its worth (for example, I wrote a linear equation solver in Scale for problem 101...) a lot of later problems assume you are capable of code reuse from previous problems, and as we don't have that, things can start getting pretty crazy to try to keep hopping from language to language. So, without further ado, to introduce what I am planning on doing next. I decided to try to find some sort od secondary way of having fun with Project Euler, and I decided on trying to minimize the amount of code I need. In particular, I initially planned on trying to minimize lines of code accross multiple problems (and thus there would be a challenge to pick the right language for the right problem to minimize LOC), but I realized that Lines of code is a terrible, erratic, difficult to measure properly measure, so I am going to try a much finer measure, which is number of characters used total. Also, for now, I don't really want to deal with trying to optimize the lines of code in all 100 problems I have solved, so I decided on a reasonable strting point: try to minimize the characters to solve the first 20 problems. And because it seels silly solving problems that can easily be solved by hand, I am using the first 20 non-Pencil and Paper solved problems. For now, I am just putting up a blog post with my current character counts on the first 20 problems based on my past work, and I will try to work on shrinking it soon. I will also need to decide on some ways to codify this soon...one of the big issues is languages where I used inlining data instead of File I/O, but I will find a good way of counting after I actually get into the challenge. Also, I am ignoring whitespace. (And therefore Whitespace will be a banned language...)
2 e2.we 331
3 e3.cat 143
4 e4.f 153
7 e7.ps 350
9 e9.arnoldc 2213
10 e10.lol 687
11 e11.io 1917
12 e12.go 356
13 e13.st 5133
14 e14.clj 219
16 e16.bas 391
17 e17.elm 1165
18 e18.pl 828
19 e19.fjo 323
20 e20.e 251
21 e21.cbl 999
22 e22.d 242
23 e23.ceylon 527
24 e24.erl 342
26 e26.es 218