Castle Paradox Forum Index Castle Paradox

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 Gamelist   Review List   Song List   All Journals   Site Stats   Search Gamelist   IRC Chat Room

Obfuscated Plotscripting Code Contest

 
Post new topic   Reply to topic    Castle Paradox Forum Index -> The Soapbox
View previous topic :: View next topic  
Author Message
TMC
On the Verge of Insanity




Joined: 05 Apr 2003
Posts: 3240
Location: Matakana

PostPosted: Thu Dec 16, 2004 8:01 am    Post subject: Obfuscated Plotscripting Code Contest Reply with quote

You know, we haven't had many (if any) plotscripting contests, so how about one that will test the extremes of your sanity? Announcing the Obfuscated Plotscripting Code Contest (based off the IOCCC to some degree), where you can prove your ability at plotscripting by showing that you are supreme at writing terrible/cool code. Your prize is just that.

Entries ought to:
-Be as impossible to read/understand as possible
-Do cool things, for a much greater chance at winning
-Be beautiful, as an optional bonus (eg, if your code looks like an ASCII picture of the Mona Lisa, I will vote for you to win)

Rules:

*The contest shall begin immediately, and there shall be at least a week, or longer if anyone requires it, before voting begins. I don't want to put time constraints on contestants, a deadline is hung only so that voting may begin when everyone is ready.
*A contestant may enter as may times as they want.
*Only contestants may vote.
*An entry consists of a scripts file, and an RPG file (with the scripts already imported and set up) containing support material for the scripts and optional a short description of how to set up the scripts to work with any random rpg file, etc.
*Scripts must compile into a working script (the same script that is in your RPG file), or be disqualified.
*The function of the script must be contained within the script, and no part of it in the RPG file aside from support like graphics, possibly music, textboxs, and animations using tiles, spinning npcs, etc. Things like a pacman game which depends on the ghosts chasing you by using the 'npc chases hero' behaviour are NOT allowed.


Voting will be like Top 30 - each voter (contestant) will rate up to 10 entries in order (and at least 5, or less if there are fewer entries), and may not vote for any of their own. First place gets 10 points, 2nd 9 points, etc.
Voters should consider the 3 points listed at the top of the thread when casting their votes.

Contestants can send their entries to me or upload them somewhere publicly, and I think I'll stick all the entries in a zip and upload it to the gamelist at the end of it.
_________________
"It is so great it is insanely great."
Back to top
View user's profile Send private message Send e-mail
TMC
On the Verge of Insanity




Joined: 05 Apr 2003
Posts: 3240
Location: Matakana

PostPosted: Thu Dec 16, 2004 8:52 am    Post subject: Reply with quote

Heres an example I wrote (not an entry). It doesn't really do anything cool (if you import it into a blank RPG file, draw random first and second tiles in the tileset, and set the script to run on newgame, you'll see a poorly animated line bouncing across the screen) but I think it is a good example of being obfuscated:

Code:
definefunction(98,c114,3,0,0,0,1,w,1
1,114,a@,1,0,115,@,2,116,0)
definescript(1/0)script/(@(114,0)@(115
9)@(102,-4)^=,200,while(1)
do(@(114,modulus(a@(114)--1,16))@(102(a@(102)
--1))@(115(a@(115)--v))if(greaterthan(a@(115)
9))then(@(115,9)v,=,-4)c114(a@(114)a@(115)1)
c114(a@(^)a@(^--1)0)@(^a@(114))@(^--1,a@(115))
^=^--2--10*equal(^210)w))globalvariable(102,v
103^)defineoperator(114--add,115,=
setvariable,1*multiply)


You aren't meant to understand that without great study (I can't), don't run away Sad.... Anyway, I'd thought I share a few uncommonly-known things to level the playingfield a bit, so that you too can write garbage like that.

*plotscr.hsd
It isn't necessary to include plotscr.hsd in your scripts file if you define everything that you are going to use in your scripts file. (or if you don't use anything o_O) Remember that this includes constants like 'autonumber' and 'true'.
*'define function'
To use functions like 'wait' and 'write maptile' you must declare them in a define function block. The easiest thing to do is to copy-paste bits out of plotscr.hsd, and then rename the functions for maximum confusion. (eg. in the example above I renamed 'wait' to 'w')
Structure:
'define function(id, name, number of args, default value for arg1, for arg2,...)'
You can change the default values to junk too, if you always supply all the arguments to functions.
*'define operator'
Operators are simply a change in the way you pass arguments to functions. You can assign scripts, functions, and hard-coded math funtions (eg. add, modulus) to operators, and any string to the name. However, unless that string is a 'commaless seperator' (eg. *, /, :=, these are hardcoded into HSpeak), you will need to put commas around your operator to use it.
Structure:
'define operator(priority,operator,function)'
The priority decides which operator is executed first when there are 2 next to each other. Low numbers are executed first. Eg. If you look at plotscr.hsd, you will see that the multiply operator is lower than the add operator, so '3+4*2' is read as '3+(4*2)'
*Reserved strings
Reserved strings can not be changed, they are hardcoded. They include strings like 'script', 'define constant', 'variable', and 'while'.
The names of math functions are also unchangable, and they are always available. The math functions are math ('add', 'modulus', etc), comparison ('equal', 'greaterthan', etc), logic ('and', 'or', etc), variable-setting ('increment', 'setvariable', etc) and 'random'(heh).
Normally you just can't use 'and', 'or' and 'xor' like functions because they are set as operators.

Remember that labels (script names, varibles, constants, etc) may be composed of any series of symbols, letters and numbers, so long as the first character isn't a number. You can even use '*' as a variable name if you don't go and define it as an operator.

Also, experiment around with use of constants. They will be evil.

The real purpose of this post was an excuse to show plotscriptors some of the finest details of the language, which likely less than a handful of people fully understand.
_________________
"It is so great it is insanely great."
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Castle Paradox Forum Index -> The Soapbox All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group