Obscurely coded pong - Printable Version +- Qbasicnews.com (http://qbasicnews.com/newforum) +-- Forum: QbasicNews.Com (http://qbasicnews.com/newforum/forum-3.html) +--- Forum: Challenges (http://qbasicnews.com/newforum/forum-10.html) +--- Thread: Obscurely coded pong (/thread-8563.html) |
Obscurely coded pong - Zack - 12-16-2005 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. Obscurely coded pong - Zap - 12-16-2005 How is pong for one person without an AI opponent? You play against the wall or what? Obscurely coded pong - yetifoot - 12-16-2005 i didnt write this pong, i took it from ABC, but heres a quick jobbie using define Code: #define biff Locate Obscurely coded pong - Anonymous - 12-16-2005 Lol Obscurely coded pong - Zack - 12-16-2005 Quote: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. Obscurely coded pong - yetifoot - 12-17-2005 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!! Obscurely coded pong - thegrogen - 12-17-2005 Code: Screen 18,,,1 : Cls 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. Re: Obscurely coded pong - NecrosIhsan - 12-17-2005 Quote: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? Obscurely coded pong - yetifoot - 12-17-2005 i broke that rule Obscurely coded pong - KiZ - 12-17-2005 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] |