Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Obscurely coded pong
#11
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
EVEN MEN OF STEEL RUST.
[Image: chav.gif]
Reply
#12
haha very funny yetifoot! Big Grin=b
url=http://gm2.ath.cx/~jupiter3888]the home of jupiter3888 -> http://gm2.ath.cx/~jupiter3888[/url]
Reply
#13
That is the biggest abuse of #define I have ever seen. Big Grin
\__/)
(='.'=) Copy bunny into your signature to
(")_(") help him gain world domination.
Reply
#14
Quote:That is the biggest abuse of #define I have ever seen. Big Grin

Not anymore

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
.14159265358979323846264338327950288419716939937510582709445
Glarplesnarkleflibbertygibbertygarbethparkentalelelangathaffendoinkadonkeydingdonkaspamahedron.
Reply
#15
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?
Reply
#16
Quote: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?
stylin:
Reply
#17
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?
Reply
#18
@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)
Reply
#19
Quote:@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.
stylin:
Reply
#20
try this one, its really fun (or not)

#define test test
test
EVEN MEN OF STEEL RUST.
[Image: chav.gif]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)