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

Pages: 1-

Pong

Name: Anonymous 2009-03-20 16:43

import java.awt.*;
import java.awt.event.*;
import java.applet.*;
public class ThrowAway extends Applet implements Runnable,MouseMotionListener{
    int x,y,dx,dy,p,w,h;   
    public void init(){
        w=getWidth();
        h=getHeight();
        new Thread(this).start();
        addMouseMotionListener(this);
    }
    public void render(Graphics g){       
        x+=dx;
        y+=dy;
        if(x<10||x>w-10){
            if(y>p&&y<p+30)
                dx=-dx;
            if(x<=0||x>w){
                dx=dy=1;
                x=y=w/2;
            }
        }
        if(y<0||y>h) dy=-dy;
        g.setColor(Color.black);
        g.fillRect(0, 0, w, h);
        g.setColor(Color.white);
        g.fillRect(0, p, 10, 30);
        g.fillRect(w-10, p, 120, 30);
        g.fillRect(x-1, y-1, 3, 3);
    }   
    public void run() {       
        Image buf=createImage(w,h);
        Graphics g=buf.getGraphics();
        while(true){           
            render(g);
            getGraphics().drawImage(buf,0,0,this);
            try{Thread.sleep(5);}catch(Exception ex){};
        }
    }   
    public void mouseMoved(MouseEvent e) {
        p=e.getY()-15;
    }
    public void mouseDragged(MouseEvent e){}
}

Name: Anonymous 2009-03-20 16:45

Features:
-Classic Gameplay
-Double Buffering
-Animation Thread
-Mouse Input
-Browser playable
-Flexible applet size

Name: Anonymous 2009-03-20 17:00

Here it is the white space free version(can't do this in python):
import java.awt.*;import java.awt.event.*;import java.applet.*;public class a extends Applet implements Runnable,MouseMotionListener{int x,y,t,u,p,w,h;public void init(){w=getWidth();h=getHeight();new Thread(this).start();addMouseMotionListener(this);}public void render(Graphics g){x+=t;y+=u;if(x<10||x>w-10){if(y>p&&y<p+30)t=-t;if(x<=0||x>w){t=u=1;x=y=w/2;}}if(y<0||y>h)u=-u;g.setColor(Color.black);g.fillRect(0,0,w,h);g.setColor(Color.white);g.fillRect(0, p, 10, 30);g.fillRect(w-10, p, 120, 30);g.fillRect(x,y,3,3);}public void run(){Image buf=createImage(w,h);Graphics g=buf.getGraphics();while(true){render(g);getGraphics().drawImage(buf,0,0,this);try{Thread.sleep(5);}catch(Exception x){};}}public void mouseMoved(MouseEvent e){p=e.getY()-15;}public void mouseDragged(MouseEvent e){}}

Name: Anonymous 2009-03-20 17:16

>>3
How about this then.
ha,ng,m,a,n={0:'\x03\x00\x00\x00\x00\x01',1:'\xe3R\x00\x03.$R\x01\x9d\x8dC\x18\xa1)\x1e\x02\x00V\xa9\n\x8a',2:'\xe3\xe2R\x00\x81\x1a0\x89\xc4F\x16F\xe5 \xf1\x90\xc5u\x81\x00\xc8\x8f\x8f\x8f\xaf\x01b\xb0h\r\x00\x89\xe9\x0f\xdb',3:'\xe3R\x00\x83x\x08\xe0\x02sj\xf4!\x82P\x1e\x9cF\x11\xc4\xc2C\xe6\xe8\x02\x01H\x00hh\r\x10\x83\x85k\x00\x08D\x13\xa3',4:'\xe3R\x00\x83x\x08\xe0\x02sj\xf4!\x825P.\x84\xa7\x11\xaf\x89\xc2\x8f\xa9\xd1G\xe1\xa3)\xd7W\x88A\xe6\xeb\x02\x01\x17\xd8\x9e\x1a \x06\x8b\xd6\x00\x00\x89n\x17}',5:'\xe3R\x00\x83x\x08\xe0\x02sj\xf4!\x825P.\x84\xa7\x11\xaf\x89\xc2\xd7\xaf\x89A\xe1\xa3)\xd7W\x80Is\x81\x8d\xaf\x01b\x00M\xd8\x14\xb1',},__import__('sys').stdin,__import__('sys').stdout.write,'abcdefghijklmnopqrstuvwxyz\'-0123456789',{'c':set(),'w': __import__('random').choice(open('/usr/share/dict/cracklib-small', 'rb').readlines()).strip()}
g=lambda:n.__setitem__('t',ng.read(1)) or (n['t'] in a and (n['c'].update(n['t']) or m(('x\x9c'+ha[len(n['c']-set(n['w']))]).decode('zlib')+'\n') or m(''.join([_ if _ in n['c'] else '.' for _ in n['w']]) + '\n'))) or (len(n['c']-set(n['w'])) >= 5 and (m('You lose. '+n['w']+'\n') or True)) or (set(n['w']).issubset(n['c']) and (m('You win! '+n['w']+'\n') or True)) or g();g()

Name: Anonymous 2009-03-20 18:16

>>4
looks like a virus

Name: Anonymous 2009-03-20 22:40

stop posting your shitty obfuscated code it is not cool, go back to proggit faggots

Name: Anonymous 2009-03-20 22:50

>>6
No.  I can't write programs that actually do anything, so I write them really shittily so no one can read them and I can pretend like they are really complex.

Name: Anonymous 2009-03-20 23:15

>>3
(can't do this in python)
Yes you can. You don't need whitespace in Python if you use semicolons.

Name: Anonymous 2009-03-20 23:22

>>8
You don't need semicolons either.

Name: Anonymous 2009-03-21 15:26

>>6
Actually, >>1 isn't obfuscated aside from the lack of comments.  It's just a short minimalist pong.

Name: Anonymous 2009-03-21 15:29

>>10
It might as well be.

Name: Anonymous 2009-03-21 15:38

stop posting your shitty obfuscated code it is not cool, go back to /prog/ faggots

Name: Anonymous 2010-12-10 10:46

Name: Anonymous 2011-02-04 18:40

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