Ben Richards
  • Member for 10 years, 6 months
  • Last seen more than 3 years ago
  • Massachusetts
How to randomize letters in a word
6 votes

Perl - 96 (or 71) characters 84 (or 59) characters This is what I came up with in Perl. Went through a few different ways to do it but this seemed shortest from what I can think of so far, at 97 ...

View answer
Program that determines whether an int is greater or lesser
5 votes

C #include<stdio.h> int main(int argc, char** argv) { int a, b; long long c; double d; printf("A: "); scanf("%d", &a); printf("B: "); scanf("%d", &b); c ...

View answer
Is it Christmas?
4 votes

I wanted to do this without parsing strings. Subsequently, there's a lot of magic numbers in my code. I did some approximation to account for leap years. No one said that it had to print it out right ...

View answer
Obfuscated Hello World
3 votes

C (333 characters) I decided to emphasize on obfuscate, with golf secondary. This is written entirely in C, and it only breaks rule #2 laid out in the original post. It also breaks I don't know how ...

View answer
Text Statistics: Return a list/array of the number of occurrences of each character used in a text file, including spaces, tabs, and new lines
2 votes

This one is relatively simple. I chose to do it in Perl (my favorite scripting language). :) Perl: 41 characters 63 characters Might be able to reduce it somewhat but this is what I'm starting with. ...

View answer
Hexadecimal To Decimal
0 votes

Perl, 39 characters print<>=~m/^[[:xdigit:]]{1,8}$/?hex$&:0 I kind of feel weird doing it this way in Perl but I believe it follows the rules, since the hex() function is a language ...

View answer