Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

prog challenge: super fast dicks

Name: Anonymous 2012-05-15 12:03

Given 5gb file filled with random ebooks in ascii.

Write a program that will count the number of times dick appears in a single line.

His name was dick turpin.
Dick was a right dick.
Bobby loves bums.

The program should output: 2

Any language, nobody can win this, but we can mock inept short sighted solutions.

Name: Anonymous 2012-05-15 12:05

NIGGERS

NIGGERS

NIGGERS

Name: Anonymous 2012-05-15 12:21

[ENTERPRISE]int main()
{
 long long int nDick = 1342177280; // 5GB / 4B (len("dick"))
 char *l;
 FILE *f = fopen("ebook", "r");
 while((l = getLine(f)) != NULL)
 {
  if(lineDefinitelyNotContains(l, "dick")) nDick--;
 }
 fclose(f);
 printf("Proven to contain %d dicks\n", nDick);
 return 0;
}
[/ENTERPRISE]

Name: Anonymous 2012-05-15 12:58

>>1
Problem is poorly defined. Why should your example output 2?
Is it because (case-sensitive) ``dick'' appears twice?
Is it because there are two lines containing ``dick'' (and if so, is the matching case-sensitive or not?)?
Is it because the line that contains the most (case-insensitive) ``dick'' contains two instances of it?

Name: Anonymous 2012-05-15 16:34

>>2
please dont be rasist in hear.thankXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Name: Anonymous 2012-05-15 17:16

sed '{:q;N;s/\n/ /g;t q}' ebook > ebook// put it all on one line
echo '1 occurrence'

Name: bampu pantsu 2012-05-29 4:58

bampu pantsu

Don't change these.
Name: Email:
Entire Thread Thread List