Forumwarz is the first "Massively Single-Player" online RPG completely built around Internet culture.
You are currently looking at Flamebate, our community forums. Players can discuss the game here, strategize, and role play as their characters.
You need to be logged in to post and to see the uncensored versions of these forums.
Viewing a Post
|
to demonstrate how awesome ruby is, here is a c version
#include <stdio> #include <memory> char inp[] = { "100011001001101010010001100010111" "000110110010110100100111001001110" "010110100100001001000111011000100" -- snip -- "100001000101010001011110111111000" "101110010111100101101000110000000\n" }; int main(void) { char out[1024]; char * pos = out; char * inpos = inp; int bits = 0; char currentc = 0; memset(out, 0, sizeof(char) * 1024); while(*inpos) { if(*inpos == '0' || *inpos == '1') { if(!(bits++ % 8)) { *pos++ = 0xFF^currentc; currentc = 0; } currentc = (currentc << 1) + (*inpos=='1'?1:0); } inpos++; } printf("%s\n", out); } |
||||||
Posted On: 04/02/2008 2:14AM | View black_jesus's Profile | # |