Qbasicnews.com

QbasicNews.Com => Challenges => Topic started by: Zack on December 16, 2005, 01:25:38 AM



Title: Obscurely coded pong
Post by: Zack on December 16, 2005, 01:25:38 AM
This may have been done...I think I recall something like it but I searched and didn't find it.
Anywho, I want you folks to design a Pong game, but code it as annoyingly and obscurely as possible. That means loads of GOTO's and useless obscurification, as confusing as possible.
The rules:
a) Must be FB compatible
b) No non-native libs allowed, only the built-in FB lib.
c) May be for one or two players, but if it's for two players they must both be humans. No AI allowed.
d) Only three seperate statements on each line. That is to say, only 2 colons ":" are allowed. Example: print "hello":print "world":print "dude" is allowed, but nothing more.


Title: Obscurely coded pong
Post by: Zap on December 16, 2005, 08:33:20 AM
How is pong for one person without an AI opponent? You play against the wall or what?


Title: Obscurely coded pong
Post by: yetifoot on December 16, 2005, 09:59:40 AM
i didnt write this pong, i took it from ABC, but heres a quick jobbie using define

Code:
#define biff Locate
#define bibble Option Explicit
#define chog Screen 12
#define z Dim Shared
#define y As Integer
#define x As Single
#define w Case
#define v gg = gg +
#define u End Sub
#define t Select
#define s As String
#define r Sub
#define q ee + 20
#define p If
#define o Line
#define n Circle
#define m CHR$(255)
#define l Then
#define k Print
#define j Loop
#define i End
#define h Else
#define g Sleep
#define f ()
#define e INKEY$
#define d Do
#define c Until
#define a To
#define kjh OR
#define kjj - 20
#define cof cc = cc * -1
#define bof dd = dd * -1
bibble
z aa y:z bb y:z cc x:z dd x:z ee y:z ff y:z gg y:z hh s
r ii (aa, jj)
o (615,aa+50)-(630,aa-50),jj,B
u
r pq f
bb=200:cc=bb/100:dd=cc:ee=575:ff=240:aa=ff:gg=0  
u
r xzx f
k "GAME OVER":g:i
u
r bv f
ii(aa,0):aa=aa-15
p aa<0 l aa=0
ii(aa,4)
u
r vb f
ii(aa,0):aa=aa+15
p aa>480 l aa=480
ii(aa,4)
u
r jug f
d c e=" ": j
u
r xzy f
t w ff
w aa-55 a aa+55
cc = cc*-1:v 1:w 0 a aa-44:xzx
w aa+55 a 480
xzx
w h
cc = cc*-1:v 1:i t
u
r lk f
chog
pq
ii(240, 4)
d
ScreenSync
biff 1, 1: k gg
n (ee,ff),20,0:ee=ee+cc:ff=ff+dd
n (ee,ff),20,2
p q > 640 kjh q < 0 l cof
p ee kjj < 0 kjh q < 0 l cof
p ff kjj > 480 kjh ff + 20 > 480 l bof
p ff kjj < 0 kjh ff + 20 < 0 l bof
p q >= 614 l xzy
hh$ = e
t w hh$
w m + "H"
bv
w m + "P"
vb
w "q"
i
w "p"
jug
i t
j
u
lk


Title: Obscurely coded pong
Post by: Anonymous on December 16, 2005, 11:24:08 AM
Lol


Title: Obscurely coded pong
Post by: Zack on December 16, 2005, 03:53:26 PM
Quote from: "Zap"
How is pong for one person without an AI opponent? You play against the wall or what?
Precisely.

Yetifoot: heheh, that's a start. Now ruin it more with gotos.


Title: Obscurely coded pong
Post by: yetifoot on December 16, 2005, 04:30:56 PM
im kicking myself really cause the original program was all gotos, real spaghetti stuff, and for some dumb reason i sat there and subbed it all!!


Title: Obscurely coded pong
Post by: thegrogen on December 16, 2005, 06:58:58 PM
Code:

Screen 18,,,1 : Cls          
points = 0
Goto begin:
start:    
Cls
Line (0,playery)-(10,playery+50), 15,bf
inputsec:
a$ = Inkey$
If a$ = "w" And playery > 0 Then playery-=20  
If a$ = "s" And playery < (479-50) Then playery+=20
If a$ = Chr$(27) Then End
Goto ball
ball:                            
ballx+=ballxvel : bally += ballyvel
Circle (ballx+10, bally+10), 10  
Goto collision
endloop:
Locate 1, 35: Print points
Sleep 16 :  Goto start
begin:
playery=0
ballx= 10 : bally = 10
ballxvel=5 : ballyvel = 5
Goto start
collision:
If ballx <= 0 Then Goto begin
If ballx <= 10 And bally > playery And bally < playery+50 Then
ballxvel = -ballxvel
points+=1
End If
If bally <= 0 Then ballyvel = -ballyvel
If ballx >= 639 Then ballxvel =-ballxvel
If bally >= 479 Then ballyvel = -ballyvel
Goto endloop


Bounce the ball off the wall. Each time you bounce the ball off the paddle, you get a point. Use the lower-case 'w' and 'a' keys to move the paddle up and down. Took me about half an hour to write.


Title: Re: Obscurely coded pong
Post by: NecrosIhsan on December 16, 2005, 07:42:26 PM
Quote from: "Zack"
d) Only three seperate statements on each line. That is to say, only 2 colons ":" are allowed. Example: print "hello":print "world":print "dude" is allowed, but nothing more.

Doesn't this sorta defeat a major obfuscation technique? :D


Title: Obscurely coded pong
Post by: yetifoot on December 16, 2005, 09:11:30 PM
i broke that rule


Title: Obscurely coded pong
Post by: KiZ on December 17, 2005, 12:04:59 AM
Wow... my head hurts now.


drawing on yeti's idea (this also breaks the rule, but what the hell)
[syntax="qbasic"]#define x if
#define xx then
#define xxx else
#define xxxx do
#define xxxxx loop
#define xxxxxx until
#define z and
#define zx line
#define zxxx input
#define zxxxx multikey
#define zxxxxx circle
#define xz wait
#define xzx flip
#define xzxx cls
#define xzxxx goto
#define xzxxxx end
#define xxz screenset
#define xxzx dim as single
#define xxzxx screen
#define xxzxxx dim as string

xxzxx 14,,2
xzzxzzx:
xxz 0, 1:xxzx zxxz, zxzx, zxzz:xxzxxx zzxx, zzzx, zzzz, zzzxx
zxz = 160:zxxz = 160:zxzx = 50:zxzz = 1:zzzz = "y":y = 35
yx = 0:yyx = 265:yyyx = 200:yyyyx = 1:yyyyyx = 260:xy = 40
xyx = 0.001:xyxx = 5:xyxxx = 175:xyxxxx = 195:xyxxxxx = 190
xxy = 240:xxyx = 75:xxyxx = 77:xxyxxx = 180:xxxy = 20
xxxyx = 60:xxxyxx = 8:xxxyxxx = &h3da:xxxxy = 3
xxxx: zx(y, yx)-(yyx, yyyx), , b: x zzx = yyyyx xx zxxz = zxxz + zxzz xxx zxxz = zxxz - zxzz
x zxxz < xy xx zzx = yyyyx xxx x zxxz > yyyyyx xx zzx = yx
zxzz = zxzz + xyx:x zzz = yyyyx xx zxzx = zxzx + zxzz xxx zxzx = zxzx - zxzz
x zxzx < xyxx xx zzz = yyyyx xxx x zxzx > xyxxx z zxxz > zxz - xxxy z zxxz < zxz + xxxy xx zzz = yx
x zxzx > xyxxxx xx xxz yyyyx,yyyyx: zxxx "play again"; zzzxx: x zzzxx=zzzz xx xzxxx xzzxzzx xxx xzxxxx
zxxxxx(zxxz, zxzx), xyxx: x zxxxx(xxyx) z zxz > xxxyx xx zxz=zxz-xxxxy
x zxxxx(xxyxx) z zxz < xxy xx zxz = zxz+xxxxy
zx (zxz-xxxy,xxyxxx)-(zxz+xxxy,xyxxxxx),,b:xz xxxyxxx,xxxyxx:xzx:xzxx:xxxxx xxxxxx zxxxx(yyyyx)[/syntax]


Title: Obscurely coded pong
Post by: yetifoot on December 17, 2005, 08:42:46 AM
this one doesnt break the rules

Code:
' S I M P L E  P O N G  
'   by Cam <Slyboots> Spowart
' Stripped and stupidified by yetifoot
' Sub -> GOTO
' Select Case -> IF
' 7 -> ((1 shl 3) - 1) etc.
' code -> lots of horrible defines
#define a1111 GOTO
#define b0000 THEN
#define b0001 IF
#define b0010 ELSEIF
#define b0011 LINE
#define b0100 END
#define b0101 CIRCLE
#define b0110 DIM
#define b0111 ((((1 shl 9) OR (1 shl 6) OR (1 shl 5)) + (1 shl 3) - 1),
#define b1000 b0011 b0111 a0101 + ((3 shl (1 shl (1 shl 1))) + (1 shl 1)))-((((1 shl 9) OR (1 shl 6) OR (1 shl 5)) + (1 shl 3) - 1) + 15, a0101 - ((3 shl (1 shl (1 shl 1))) + (1 shl 1))),
#define b1001 (1 shl (1 shl (1 shl 1)) OR 1 shl (1 shl 1)) >
#define b1010 And a0100
#define b1011 (1 shl (1 shl (1 shl 1)) OR 1 shl (1 shl 1)) < 0
#define b1100 b1000 0,
#define b1101 b0010 a0100 >=
#define b1110 a0110[0] =
#define b1111 b1000 (1 shl (1 shl 1)), B:a1111 a1000
#define c0000 Or a0100 +
#define c0001 Or a0011 + b1011 b0000 a0001 = a0001 * -1
#define c0010 b1100 B:a0101 = a0101
#define c0011 a0010 = a0010 * -1
#define c0100 b1010 <=
#define c0101 b0001 a0011
#define c0110 b0010 b1110
#define c0111 a1111 a1110
#define c1000 b0001 a0101
#define c1001 Sleep
#define c1010 b0000 a0101 =
#define c1011 b0001 a0100 -
#define c1100 c0101 + b1001
#define c1101 (a0101 + 55)
#define c1110 a0001 = a0001 * -1
#define c1111 (a0101 -
#define d0000 a1111 a1001
#define d0001 = INKEY$
#define d0010 b0101 (a0011, a0100), (1 shl (1 shl (1 shl 1)) OR 1 shl (1 shl 1)),
#define d0011 Do
#define d0100 Loop
#define d0101 Else
#define d0110 = (((1 shl (1 shl (1 shl 1)))-1) shl (1 shl (1 shl 1)))
#define d0111 (((1 shl (1 shl (1 shl 1)))-1) shl ((1 shl (1 shl 1))+1))
#define d1000 Screen
#define d1001 As Single
#define d1010 As ZString * 2
#define d1011 a0011 =
#define d1100 a0100 >= c1111
#define d1101 =
#define d1110 ((1 shl (1 shl (1 shl 1)))-1)
#define d1111 +
#define e0000 /
#define e0001 50)-(630,
#define e0010 b1101 (0) c0100 c1111 44) b0000
#define e0011 (((1 shl (1 shl (1 shl 1)))-1) shl (1 shl (1 shl 1))) d1111 e0001 (((1 shl (1 shl (1 shl 1)))-1) shl (1 shl (1 shl 1))) - 50), (1 shl (1 shl 1)), B
#define e0100 100:d1011 575:a0100
#define e0101 b1101 c1101 c0100 (d0111) b0000
#define e0110 ((1 shl (1 shl (1 shl 1)))-(1 shl (1 shl 1))):a0000 d1101 200:a0001
#define e0111 ScreenSync
#define __THIS a0111:
#define __IS d1000 e0110 d1101 a0000 e0000 100
#define __GETTING a0010 d1101 a0000 e0000 e0100 d0110
#define __QUITE a0101 d0110:b0011 b0111 e0011
#define __RIDICULOUS d0011
#define __NOW a1000:
#define __BUT e0111:d0010 0:d1011 a0011 d1111 a0001
#define __IN a0100 d1101 a0100 d1111 a0010:d0010 (1 shl 1)
#define __THE c1100 640 c0001
#define __WORDS c0101 - b1011 c0001
#define __OF c1011 b1001 d0111 c0000 b1001 d0111 b0000 c0011
#define __MAGNUS c1011 b1011 c0000 b1011 b0000 c0011
#define __MAGNUSSON c1100= 614 a1111 a1101
#define __I a0110 d0001
#define __HAVE b0001 b1110 97 b0000
#define __STARTED a1111 a1011  
#define __SO c0110 122 b0000
#define __I_ a1111 a1100
#define __SHALL c0110 27 b0000
#define __FINISH a1111 a1010
#define __o_ c0110 112 b0000
#define __PS c1001
#define __THIS_ b0100 b0001
#define __IS_ a1001:
#define __PROBABLY d0100
#define __THE_ a1010:
#define __WORST_ b0100
#define __VERSION a1011:
#define __OF_ c0010 - d1110
#define __PONG c1000 < 0 c1010 0
#define __I__ b1111
#define __HAVE_ a1100:
#define __EVER c0010 d1111 d1110
#define __SEEN c1000 > d0111 c1010 d0111
#define __o__ b1111
#define __THE__ a1101:
#define _KEYS b0001 d1100 55) c0100 c1101 b0000
#define _ARE c1110
#define _A d0000
#define _FOR e0010
#define _UP c0111
#define _AND e0101
#define _Z c0111
#define _FOR_ d0101
#define _DOWN c1110
#define _0_0_ d0000
#define _0_0_0_ b0100 b0001
#define _0_0_0_0_ a1110:
#define _END c1001
#define _OF_ b0100
#define _FILE d0000
Option Explicit
b0110 d1001 a0000, a0001, a0010, a0011, a0100, a0101:b0110 a0110 d1010
__THIS
__IS
__GETTING
__QUITE
__RIDICULOUS
__NOW
__BUT
__IN
__THE
__WORDS
__OF
__MAGNUS
__MAGNUSSON
__I
__HAVE
__STARTED
__SO
__I_
__SHALL
__FINISH
__o_
__PS
__THIS_
__IS_
__PROBABLY
__THE_
__WORST_
__VERSION
__OF_
__PONG
__I__
__HAVE_
__EVER
__SEEN
__o__
__THE__
_KEYS
_ARE
_A
_FOR
_UP
_AND
_Z
_FOR_
_DOWN
_0_0_  
_0_0_0_
_0_0_0_0_
_END
_OF_
_FILE


Title: Obscurely coded pong
Post by: jupiter3888 on December 17, 2005, 10:48:37 AM
haha very funny yetifoot!  :D=b


Title: Obscurely coded pong
Post by: NecrosIhsan on December 17, 2005, 12:51:03 PM
That is the biggest abuse of #define I have ever seen. :D


Title: Obscurely coded pong
Post by: thegrogen on December 17, 2005, 02:13:37 PM
Quote from: "NecrosIhsan"
That is the biggest abuse of #define I have ever seen. :D


 Not anymore (http://www.gamedev.net/community/forums/ViewReply.asp?id=1991967)

edit: ported to FB:
Code:

#Define X
#Define XX X
#Define XXXX XX
#Define XXXXXXXXXX XXXX
#Define XXXXXXXXXXXX Sleep
#Define XXXXXXXXXXXXXXXXXXXXXX  Print "Hello, world!"


          XXXXXXXXXX
      XXXX          XXXX
    XX  XXXX      XXXX  XX
  XX  XX    XX  XX    XX  XX
  XX                      XX
XX  XXXXXXXXXXXXXXXXXXXXXX  XX
XX  XX    XX      XX    XX  XX
XX  XX    XX      XX    XX  XX
XX  XX    XX      XX    XX  XX
XX  XX    XX      XX    XX  XX
 XX  XX   XX      XX   XX  XX
  XX    XXXX      XXXX    XX
    XX    XXXXXXXXXX    XX
      XXXX          XXXX
         XXXXXXXXXXXX


Title: Obscurely coded pong
Post by: axipher on December 17, 2005, 03:50:10 PM
Well although this is abusing #define, now I know what it does, it could shorten programming by diong something like this:

Code:
#define @p PRINT
#define @i IF
#define @t THEN
etc...


It could take a while to define shortcuts for each command, but then typing long programs would be much easier would it not?


Title: Obscurely coded pong
Post by: stylin on December 17, 2005, 04:15:46 PM
Quote from: "axipher"
Well although this is abusing #define, now I know what it does, it could shorten programming by diong something like this:

Code:
#define @p PRINT
#define @i IF
#define @t THEN
etc...


It could take a while to define shortcuts for each command, but then typing long programs would be much easier would it not?

... Could you give an example program using those #defines?


Title: Obscurely coded pong
Post by: axipher on December 17, 2005, 05:05:07 PM
Well I haven't really written a program using those, I was just guessing, i ave a ? at end of post don't I, I think from what I saw that would work, or can variables only have letters and numbers?


Title: Obscurely coded pong
Post by: Anonymous on December 17, 2005, 06:53:10 PM
@axipher... you dont want that dude... all that will do is make your program harder to understand when you make mistakes and have to debug (like the rest of the imperfect world)


Title: Obscurely coded pong
Post by: stylin on December 17, 2005, 07:21:48 PM
Quote from: "Cha0s"
@axipher... you dont want that dude... all that will do is make your program harder to understand when you make mistakes and have to debug (like the rest of the imperfect world)

Well, in his defense this is an obfuscation contest. At any rate, yes axipher, in FreeBASIC, variable names can only contain letters, numbers, underscores and type symbols (same as in QB, less the underscores).

MACROs aren't variables, but my understanding is that the PP uses the same identifier rules, less the type symbols. Someone please clarify if this is incorrect.


Title: Obscurely coded pong
Post by: yetifoot on December 17, 2005, 07:28:15 PM
try this one, its really fun (or not)

#define test test
test


Title: Obscurely coded pong
Post by: Z!re on December 17, 2005, 08:34:31 PM
yetifoot's code is the best =)
axipher is stupid..

Anything I missed?


Title: Obscurely coded pong
Post by: Deleter on December 17, 2005, 09:20:32 PM
Quote from: "Z!re"
yetifoot's code is the best =)
axipher is stupid..

Anything I missed?

nope


Title: Obscurely coded pong
Post by: KiZ on December 18, 2005, 03:17:38 PM
Quote from: "Deleter"
Quote from: "Z!re"
yetifoot's code is the best =)
axipher is stupid..

Anything I missed?

nope


Funny. I was about to say that exact same thing

*whistles and looks around the room*


Title: Obscurely coded pong
Post by: Zack on December 18, 2005, 03:52:42 PM
I didn't even know FB had #define!

Yetifoot wins.


Title: Obscurely coded pong
Post by: axipher on December 18, 2005, 04:13:20 PM
Quote from: "KiZ"
Quote from: "Deleter"
Quote from: "Z!re"
yetifoot's code is the best =)
axipher is stupid..

Anything I missed?

nope


Funny. I was about to say that exact same thing

*whistles and looks around the room*


I know EH...  Hey, wait a minute :-? ,was that a dis :???: I think it was, but you missed one thing, I'm also a part of this board, think about how it would be if I never joined, these good times and someone to flame would have never happened now would they have :D


Title: Obscurely coded pong
Post by: whitetiger0990 on December 18, 2005, 05:03:39 PM
Not true. Someone else always joins *coughhardeepcough*.=p



@pong games: wow =D


Title: Obscurely coded pong
Post by: axipher on December 18, 2005, 05:10:45 PM
But I'm sure they either wouldn't be as annoying as me, or would me much more annoying then me and get banned :rotfl:


Title: Obscurely coded pong
Post by: KiZ on December 18, 2005, 05:18:19 PM
Bah. Noone gets banned around here now Oracle is gone. :'( I miss those days...


Title: Obscurely coded pong
Post by: Deleter on December 18, 2005, 05:39:56 PM
Maybe not as obscure, but fun to play :)
Code:
#define pingpong sub
#define ping if
#define pong then
#define paddle line
#define bouncy (
#define play end
#define p1ng elseif
#define pingpongtime timer
dim shared as single pongisfun=240,pw=16,boingboingboing=64,whypongisfun=0,ps=1,boing=320,boingboing=240,bxs,bys,br=10,ms=200,sx=640,sy=480,tm,cs,a,sc,sl=20
pingpong resetit()
    ps-=1
    boing=sx/2
    boingboing=sy/2
    pongisfun=sy/2-boingboingboing/2
    whypongisfun=0
    a= bouncy 1.5*rnd-.75)+3.14*int bouncy rnd*2)
    bxs=cos bouncy a)*ms
    bys=sin bouncy a)*ms
play pingpong
pingpong moveit()
    tm=pingpongtime-tm
    ping multikey bouncy 72) or multikey bouncy 80) pong whypongisfun+=ms*4*tm*sgn bouncy multikey bouncy 80)*2-1)    
    ping abs bouncy whypongisfun) > ms pong whypongisfun=ms*sgn bouncy whypongisfun)
    pongisfun+=whypongisfun*tm
    whypongisfun= bouncy 1-tm)*whypongisfun
    ping pongisfun < boingboingboing/2 pong
        pongisfun=boingboingboing/2
        whypongisfun=-whypongisfun
    play ping
    ping pongisfun > sy-boingboingboing/2 pong
        pongisfun=sy-boingboingboing/2
        whypongisfun=-whypongisfun
    play ping
    boing+=bxs*tm
    boingboing+=bys*tm
    ping boing >= sx-br pong
        boing=sx-br-1
        bxs=-bxs
    p1ng boing-br <= pw pong
        ping boingboing+br > pongisfun-boingboingboing/2 pong
            ping boingboing-br < pongisfun+boingboingboing/2 pong 'collide with paddle
                boing=pw+br
                bxs=-bxs
                ps+=1
            play ping
        play ping
        ping boing-br <= 0 pong resetit()
    play ping
    ping boingboing+br > sy pong
        boingboing=sy-br
        bys=-bys
    p1ng boingboing < br pong
        boingboing=br
        bys=-bys
    play ping
    sc+=tm*8
    tm=pingpongtime
play pingpong
pingpong drawit()
    cls
    me$="                    Obscure Pong Coded By: Deleter  -  Your Score: "+str$(ps)+"        Buy pi!             "
    ping int bouncy sc)>len bouncy me$)-sl/2 pong sc=1
    locate 1,(sx/16+1)-sl/2
    print mid$(me$,int bouncy sc),int bouncy sl))    
    circle bouncy boing,boingboing),br,7
    paddle bouncy 0,pongisfun-boingboingboing/2)-(pw-1,pongisfun+boingboingboing/2),4,b
    paddle bouncy sx/2-sl*4-2,-1)- bouncy sx/2+sl*4+2,10),4,b
    paddle bouncy sx/2-sl*4-3,-1)-bouncy sx/2+sl*4+3,11),12,b
    paddle bouncy sx/2-sl*4-1,-1)-bouncy sx/2+sl*4+4,12),4,b    
play pingpong
tm=pingpongtime
randomize pingpongtime
screenres sx,sy,8,2
sleep 10
resetit
do
    moveit
    drawit
    sleep 1,1
    screenset cs,- bouncy cs-1)
    cs=- bouncy cs-1)
loop until multikey bouncy 1)


Title: Obscurely coded pong
Post by: axipher on December 18, 2005, 06:00:12 PM
Your right, it is pretty fun to play, although making the ball go faster and faster would be nice.


Title: Obscurely coded pong
Post by: yetifoot on December 18, 2005, 08:37:15 PM
shocker!!!
Quote
bxs=cos bouncy a)*ms

genuine angles!!


Title: Obscurely coded pong
Post by: Deleter on December 18, 2005, 08:37:25 PM
ok i know this one doesn't count at all, although how it works is a little obscure even to me (coding on caffiene...). But its fun as heck to play. (you can move up down and left <-> right
Code:
#define pi (3.14/180)
dim shared as single py=240,px,pw=16,ph=64,pys=0,pxs=0,ps=1,bx=320,by=240,bxs,bys,br=10,ms=200,sx=640,sy=480,tm,cs,a,sc,sl=20,a2,pdx
pdx=100
px=pdx
function Distance (x1 as single,y1 as single,x2 as single,y2 as single) as single
    return sqr( ( x1 - x2 ) ^ 2 + ( y1 - y2 ) ^ 2 )
end function
function Angle(x1 as single,y1 as single,x2 as single,y2 as single) as single
    dim as single tempAngle, tempY, tempX
    tempX = x1 - x2
    tempY = y1 - y2
    tempAngle = ( atn ( tempY / tempX ) )/pi
    if tempX < 0 XOR tempY < 0 then tempAngle = tempAngle + 180
    if tempY >= 0 then tempAngle = tempAngle + 180
    return tempAngle
end function
sub resetit()
    ps-=1
    bx=sx/2
    by=sy/2
    py=sy/2
    pys=0
    pxs=0
    px=pdx
    a=(1.5*rnd-.75)+3.14*int(rnd*2)
    bxs=cos(a)*ms
    bys=sin(a)*ms
end sub
sub moveit()
    tm=timer-tm
    if multikey(72) or multikey(80) then pys+=ms*4*tm*sgn(multikey(80)*2-1)
    if multikey(75) or multikey(77) then pxs+=ms*4*tm*sgn(multikey(77)*2-1)
    if abs(pys) > ms then pys=ms*sgn(pys)
    if abs(pxs) > ms then pxs=ms*sgn(pxs)
    py+=pys*tm
    px+=pxs*tm
    pys=(1-tm)*pys
    if px > pdx then pxs-=abs(px-pdx)*tm*ms/8 else pxs+=abs(px-pdx)*tm*ms/8
    pxs=(1-.9*tm)*pxs
    if py < ph*2/3 then
        py=ph*2/3
        pys=-pys
    end if
    if py > sy-ph*2/3 then
        py=sy-ph*2/3
        pys=-pys
    end if
    bx+=bxs*tm
    by+=bys*tm
    if bx >= sx-br then
        bx=sx-br-1
        bxs=-bxs
        ps+=1
    elseif bx-br <= px+(ph*2/3) then
       
        if Distance(px,py,bx,by) <= (ph*2/3+br) then
            a=2*Angle(bx,by,px,py)-Angle(bxs,bys,0,0)
            bxs=cos(a*pi)*ms+pxs/2
            bys=sin(a*pi)*ms+pys/2
            a2=Angle(bx,by,px,py)+180
            bx=cos(a2*pi)*(ph*2/3+br)+px
            by=sin(a2*pi)*(ph*2/3+br)+py
        end if
       
        if bx <= 0 then resetit()
    end if
    if by+br > sy then
        by=sy-br
        bys=-bys
    elseif by < br then
        by=br
        bys=-bys
    end if
    sc+=8*tm
    tm=timer
end sub
sub drawit()
    cls
    color 15,4
    me$="                    Slider Pong Coded By: Deleter  -  Your Score: "+str$(ps)+"        Buy pi!             "
   
    line (sx/2-sl*4-2,-1)-(sx/2+sl*4+2,10),4,bf
    line (sx/2-sl*4-3,-1)-(sx/2+sl*4+3,11),12,b
    line (sx/2-sl*4-4,-1)-(sx/2+sl*4+4,12),4,b  
    locate 1,(sx/16+1)-sl/2
   
    if int (sc)>len(me$)-sl/2 then sc=1
    print mid$(me$,int(sc),int(sl))    
    color ,0
    circle (bx, by), br, 2,,,, F
   
    line (pdx,0)-(px,py),4
    line (pdx,sy)-(px,py),4
    circle(px,py),ph*2/3,4,,,, F
    print int(Distance(bxs,bys,0,0))
end sub
tm=timer
randomize timer
screenres sx,sy,8,2
sleep 10
input "Difficulty? (1=easy, higher=harder)"; ms
ms*=100
resetit
do
    moveit
    drawit
    sleep 1,1
    screenset cs,-(cs-1)
    cs=-(cs-1)
loop until multikey(1)


Title: Obscurely coded pong
Post by: axipher on December 18, 2005, 10:12:08 PM
That's, maybe it's not obscure, but it's damn sweet and fun to play.


Title: Obscurely coded pong
Post by: Deleter on December 21, 2005, 07:45:11 PM
so are you actually going to judge or...?


Title: Obscurely coded pong
Post by: axipher on December 21, 2005, 11:18:24 PM
I guess so.  Well I think that one takes the cake so far for best version, and the bouncy = ( is very smart and effective, really confuses the reader, but the "paddle" is damn sweet, me and some friends got to 800 today at school on about 7 difficulty without dieing, we all had fun, that's a;; we do in drafting and I have an 84...  If only life were that easy.


Title: Obscurely coded pong
Post by: KiZ on December 22, 2005, 12:32:16 AM
Quote from: "Deleter"
so are you actually going to judge or...?


Quote from: "Zack"
Yetifoot wins.



Axipher, he wasnt speaking to you. The competition starter does the judging.