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: Anonymous 2009-07-28 19:48

>>36
i suppose when you're so much of a 1337 anti-conformist faggot who never read his K&R you have no way to learn about null termination.
enjoy your horribly inefficient, buggy code, you pathetic excuse for a progragrammer, you.

Name: Anonymous 2009-07-28 20:01

never read his K&R
You serious?

Name: Anonymous 2009-07-28 20:14

>>42
Yes.
If you want to learn C and not be a horrible horrible failure like Mr Void you read K&R. This is well established and there is no way around it.
Books often provide the best way to learn a language, providing much more depth and detail than tutorial websites and just guessing.

Sadly, FV doesn't believe in reading books; this causes him to not understand even the most basic language concepts, and, subsequently fail at all his C programming efforts.
What happened to your infinite compression program, FV? Oh, right! You couldn't get it to work because "gcc is buggy".
doh ho ho, how pathetic

Name: Anonymous 2009-07-28 21:21

>>36
Oh, Christ.
Now I understand why he doesn't beautify his code. It's so anyone unmotivated enough won't see how much he fails.
Seriously, how long have you been writing C? This is on the level of "a few weeks".

Name: Anonymous 2009-07-28 21:25

>>39

He went to microwave his food.

Name: !Double-Shot-Of-Java 2009-07-28 21:38

Did someone say Image Processing?
Eclipse + Java wins again!
Now where do I go to claim my prize? I hope its an ENTER-prize! <3


import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.image.FilteredImageSource;
import java.awt.image.ImageFilter;
import java.awt.image.ImageProducer;
import java.awt.image.RGBImageFilter;
import java.awt.*;

import javax.swing.JOptionPane;


public class app extends java.applet.Applet  {

     private static final long serialVersionUID = 1L;
     Image PWNAGE;
     Image one;
     Image two;
     Graphics bg;
     Image screen;
     Dimension dim;

     Font goodFont = new Font("Helvetica", Font.PLAIN,  22);
   
     public void init() {
          setBackground(new Color(0).white); 
          setSize(1280, 1024);
          dim = getSize();
          screen = createImage(dim.width, dim.height);
          bg = screen.getGraphics();
          addMouseListener(this);
       
       
          one = getImage(getDocumentBase(),JOptionPane.showInputDialog(null, "Type in first image file name."));
          two = getImage(getDocumentBase(),JOptionPane.showInputDialog(null, "Type in second image file name."));
       
       
       
          try {
       
               PWNAGE = makeColorTransparent(two, new Color(0).blue);
          }
          catch(Exception e) {}
     }
   
     public void paint(Graphics g) {     
          bg.clearRect(0, 0, dim.width, dim.height);
          bg.drawImage(one, 0, 0,this);
          bg.drawImage(PWNAGE, 0, 0,this);
          g.drawImage(screen, 0, 0, this);
     }
     
     public void update(Graphics g){
          paint(g);
     }
   
     public static Image makeColorTransparent(Image im, final Color color) {
          ImageFilter filter = new RGBImageFilter() {
               public final int filterRGB(int x, int y, int rgb) {
                    return 0xBDFFFFFF & rgb;
               }
          };
          ImageProducer ip = new FilteredImageSource(im.getSource(), filter);
          return Toolkit.getDefaultToolkit().createImage(ip);
     }
}

Name: Anonymous 2009-07-28 21:47

>>46
I am NOT downloading eclipse to see if this works. You win an enterprize GAY SEX PARTNER

Name: !3LrT5NRVks 2009-07-28 21:47

>>46
I approve of this post.

Name: Anonymous 2009-07-28 21:54

>>46
Well, if you delete the addMouseListener(this); it compiles and works! Why the hell is that line in there anyway?

Name: !Double-Shot-Of-Java 2009-07-28 21:56

>>49
Ahh, well I did put in some mouse functionality, but at the last minute I decided it was unnecessary. Guess I forgot to take that part out lol!

Name: Anonymous 2009-07-28 21:57

>>46
Disqualified for not C.

Name: Anonymous 2009-07-28 22:10

This thread is disqualified for not enterprise. Plus, the rest of the contestants are now just gonna kopipe the java code and translate it to C.

Name: Anonymous 2009-07-28 22:16

#include <iostream.h>

Name: Anonymous 2009-07-28 22:21

If there arnt any C entries, looks like javaMcFaggot wins

Name: Anonymous 2009-07-28 22:24

kopipe the java code and translate it to C
Hahaha.
U MENA HASKAL

Name: Anonymous 2009-07-28 22:25

main(){
    system("./image_processor jpg1.jpg jpg2.jpg");
}


The first and only REAL entry.
Suppose that means i win

Name: Anonymous 2009-07-28 22:28

>>56
Well yea, but your competitors still have 16.5 hours.

Name: Anonymous 2009-07-28 22:33

>>55
Put that in your kopipe and smoke it

          . . .
         .. .
        ;;
 _____(--)
{_______|

Name: Anonymous 2009-07-28 22:36

>>55
The only language I know is lisp. I figure tard languages like java and C are nearly interchangeable.

Name: Anonymous 2009-07-28 22:37

>>59
i lol'd when i read this.
it's an obvious troll, so i'll leave it at that

Name: Anonymous 2009-07-28 22:51

>>59
I prefer Basic, Visual Basic that is.

Name: Anonymous 2009-07-28 22:54

>>61
Visual Basic .NET, I presume?

Name: Anonymous 2009-07-28 22:56

qbasic.net

Name: Anonymous 2009-07-28 22:58

fffffffffffffffffffffffffffffffff

Name: Anonymous 2009-07-28 23:08

We should extend this to ALL languages.

Name: Anonymous 2009-07-28 23:12

>>65
public class /prog/ extends all.languages implements postlistener

Name: Anonymous 2009-07-28 23:27

>>65
All in favor?

Name: Anonymous 2009-07-29 0:06

The first round is TOO FREEKING HARD IN C! Who votes for a new assignment?

Name: Anonymous 2009-07-29 0:38

>>68
OK. I propose factorial.

Name: Anonymous 2009-07-29 0:40

>>69
FUCK YOU.
I propose fibs

Name: Anonymous 2009-07-29 0:48

Ok new Stage 1: Program a square root calculator using your own square root finding algorithm.

Name: Anonymous 2009-07-29 1:08

>>71
I see that you have read your SICP.

Name: Anonymous 2009-07-29 1:11

    ( ≖‿≖)  D
    ( ≖‿≖ )   I
    (≖‿≖ )  C
    (‿≖   )   K
    (≖   )   
    (     )   T
    (     )   O
    (   ≖)   W
    (  ≖‿)   E
    ( ≖‿≖)  R

Name: Anonymous 2009-07-29 2:34

hmm

Name: Anonymous 2009-07-29 3:58

Wow, I declare java the winner.

Name: Anonymous 2009-07-29 4:03

>>73
you forgot some spoilers and spaces there son .

Name: Anonymous 2009-07-29 4:04


#include <stdlib.h>

int main()
{
    system("convert -combine pic1.jpg pic2.jpg out.jpg");
    system("feh out.jpg");
    return 1+2-3;
}

Name: Anonymous 2009-07-29 4:24

>>77
You cannot use a file.  My idea is to create a data: link and pass it to Firefox, but I wonder if it would work for huge files.

Name: Anonymous 2009-07-29 4:32

>>78
allow me to fix his entry then:
#include <stdlib.h>
int main()
{
   system("convert -combine pic1.jpg pic2.jpg | feh");
}

Name: Anonymous 2009-07-29 4:34

>>46
Holy fuck. Double shot of douchebag's program really works and Im impressed. I'm thinking about learning Java now.

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