Search found 5 matches

by xulfer
Thu Nov 19, 2009 2:35 pm
Forum: Challenges Solved
Topic: Telecran
Replies: 24
Views: 1938

I had a lot of fun with this one. I decided to implement mine using gd. When ran this will output the answer in a jpeg file (white on black). The string given is in the format "udlr". compilation: gcc -o telecran telecran.c -lgd -ljpeg #include <stdio.h> #include <stdlib.h> #include <strin...
by xulfer
Thu Nov 05, 2009 12:43 am
Forum: Challenges Solved
Topic: Delegates
Replies: 17
Views: 2031

Thanks a lot. Nasm is something that I always have a lot of fun doing things in. Hopefully I can find other challenges that could make use of it soon.
by xulfer
Wed Nov 04, 2009 3:11 am
Forum: Challenges Solved
Topic: Pi Hates Nines
Replies: 26
Views: 3141

Perl

Code: Select all

my @seq = split(/9/, $pstr);
my $idxmax = 0;
$seq[$idxmax] > $seq[$_] or $idxmax =$_ for 1 .. $#seq;
print $seq[$idxmax], "\n";
$pstr contains the first million digits of pi. The rest is pretty self explanatory.
by xulfer
Tue Nov 03, 2009 6:31 pm
Forum: Challenges Solved
Topic: Delegates
Replies: 17
Views: 2031

Hadn't solved anything using NASM yet so I figured I'd go ahead and have a little fun on this one. compile: nasm -felf32 sourcefile.asm ld -o delegate sourcefile.o or on x86_64 systems ld -m elf_i386 -o delegate sourcefile.o section .data rprefix: db "Result: " rplen: equ $-rprefix eol: db...
by xulfer
Mon Nov 02, 2009 10:57 pm
Forum: Challenges Solved
Topic: Valuation
Replies: 103
Views: 8880

About five minutes in C. I'm pretty happy with the efficiency at least. #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <ctype.h> int main(int argc, char **argv) { int sum = 0; int digit[2]; char dchar[2]; char *rawptr; if (argc < 2) { fprintf(stderr, "In...