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

Code off

Name: Anonymous 2009-07-28 13:59

Welcome to the first annual /prog/ Code off !

The language will be C.

Compeptitors include (in no particular order):

Mr. Ribs
Xarn
FV
Anonymous
W. T. Snacks

Rumor has it, that there may be a special guest appearance from either The Sussman or
Leah Culver.

What's the point of this, you ask?

It's to determine who is an EXPERT PROGRAMMER.

Marking criteria:

Optimization
Elegance

Bonus marks:
indentation

Good luck!

Name: !MILKRIBS4k 2009-07-28 14:03

I am by no means a C EXPERT, but I will give it a go!

Name: Anonymous 2009-07-28 14:16

>>2

you are no Mr. too

Name: Anonymous 2009-07-28 14:17

inb4 40 submissions of fibs and facts in C

Name: Anonymous 2009-07-28 14:36

>>2
You're an anus! *grabs löb*

Name: Anonymous 2009-07-28 14:39

>>4
It doesn't feel right in C. For instance, f@(_:fs) = 0 : 1 : zipWith (+) f fs takes its elegance from the contrived form which cannot be rendered in C.

Name: Anonymous 2009-07-28 14:41

Official Code Off: STAGE 1

Image Processing

You must code a program that takes in any two .jpegs of the same resolution, and combines them equally (on top of each other) into a single image of the same resolution. The output must be displayed on screen. Writing the output image to a file is unacceptable. All code will be tested with image pairs at resolutions of 10x10, 100x100, and 1000x1000.

Each contestant has 24 hours to complete. Code must be posted in this thread by 3pm eastern tomorrow.

Name: Anonymous 2009-07-28 14:41

>>7
ololol

Name: Anonymous 2009-07-28 14:54

>>7 enjoy your reference jpeg encoder

Name: Anonymous 2009-07-28 14:56

>>9
I will, along with my job.

Name: Anonymous 2009-07-28 14:59

>>7
Aww shit this looks a little tough for stage one don't you think?

Name: Anonymous 2009-07-28 15:00

>>7
I assume you have to manipulate the RGB values and not reference jpeg encoding...

Name: Anonymous 2009-07-28 15:02

>>7
Sounds good. You're on OP!

Name: Anonymous 2009-07-28 15:03

>>7

#include "hibbit.h"

int main() {
    combine_and_display("image1.jpg", "image2.jpg");
}


Do I win yet?

Name: Anonymous 2009-07-28 15:08

>>12 Yes, but you still have to encode/decode the jpeg

Name: Anonymous 2009-07-28 15:10

asshole lol

Name: Anonymous 2009-07-28 15:10

>>14
Not unless you post the code for combine_and_display()

Name: Anonymous 2009-07-28 15:10

>>14
THE GAME CODE OFF

Name: Anonymous 2009-07-28 15:11

combine :: Image -> Image -> Image
combine i1 i2 = --todo

Name: Anonymous 2009-07-28 15:12

You should provide some jpg standard dox.

Name: Anonymous 2009-07-28 15:14

This is a 1-liner in the SICP picture language

Name: Anonymous 2009-07-28 15:17

>>17
void combine_and_display(one, two)
{
    combine(one, two);
    display(one, two);
}


Do I win yet?

Name: Anonymous 2009-07-28 15:20

>>22
Almost!

Name: Anonymous 2009-07-28 15:28

Official Code Off: STAGE 2

GUI

Make GIMP usable.  You have 20 years.

Name: Anonymous 2009-07-28 15:32

The GIMP is perfectly usable already, done!

Name: Anonymous 2009-07-28 15:32

>>7
combines them equally (on top of each other)
What the fuck does this mean?

Name: Anonymous 2009-07-28 15:40

>>7

Like the arithmetic mean of the RGB values of the two pixels?

As I see it: use SDL to load two JPEGs. Combine them into one JPEG. Display the result. Should be easy. Why write an encoder/decoder when there are libraries?

Name: !MILKRIBS4k 2009-07-28 15:41

>>7
I don't think I am capable of this! I have failed on round one! :(

Name: Anonymous 2009-07-28 15:50

>>28
Hohoho.

Name: Anonymous 2009-07-28 16:21

>>27
YES thats one way of doing it

Name: Anonymous 2009-07-28 16:35

ITT: OP tries to get /prog/ to do his homework.

Name: Anonymous 2009-07-28 16:43

Once, one guy asked me to do his homework project thing. I gave him both the source and compiled code, and when he ran it in the lab, the professor saw a stream of the word ``PENIS'' displayed every second after two minutes of running the program. I guess he never tested it for more then two minutes. Anyway, he kicked my ass after that, but I'm still glad I did it.

Name: Anonymous 2009-07-28 16:45

>>32
It was worth it.

Name: Anonymous 2009-07-28 16:56

>>32
s/then/than

Name: Anonymous 2009-07-28 17:29

No thanks. I hate writing in C almost as much as I hate writing in Sepples.

Name: =+=*=F=R=O=Z=E=N==V=O=I=D=*=+= !frozEn/KIg 2009-07-28 17:41

>>7 Easy:
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
//syntax combine jpeg1 jpeg2
void main(int argc,char **argv){int clen=(strlen(argv[1])>strlen(argv[2]))?strlen(argv[1]):strlen(argv[2]);int i;
for(i=0;i<clen;i++){putchar(argv[1][i]^argv[2][i]);}}

_______________________________
http://xs135.xs.to/xs135/09042/av922.jpg
Velox Et Astrum gamedev forum: http://etastrum.phpbb3now.com
It looks like a vortex -- a gateway into another dimension.

Name: Anonymous 2009-07-28 18:16

>>36

I sense a memory leak of Firefox epic proportions.

Name: Anonymous 2009-07-28 18:32

>>36
OH, YOU! XD

Name: Anonymous 2009-07-28 18:40

what happened to frozen chef? I enjoyed reading his posts

Name: Anonymous 2009-07-28 19:42

>>39
Probably lost interest. Can you blame him?

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