1024 byte scripting contest

Author Topic: 1024 byte scripting contest  (Read 17385 times)

Results are posted down in the table.

Thought I'd host one of these for fun to get some people thinking in a different mindset than usual. I asked around and a couple people are interested (who most of got a head start, it seems), and hopefully a few more will see this topic and give it a try. There's not a prize (at least not yet), as it's just for fun, so even if you don't think you'll win, give it a go and practice your scripting.

Basically, all you need to do is create a single-file script that does something neat. It could make fireworks via bullets, it could be some sort of mathematical algorithm; anything really. The catch is, the contents of the file have to total to 1024 bytes or less. Also, I'll be running these on a clean install, so you can't rely on any non-default add-ons. Important: Code normally, then copy the file and replace function and variable names with one or two letter ones, and remove all whitespace to shorten it to under 1024 bytes. Your script won't be able to be as complex if you don't do this, because you'll hit the byte limit fairly quickly.

There's no strict deadline for when these have to be completed, so if you're intested let me know here and PM (not post) me your entry when you're done. For general planning, it's not going to be a month long, maybe a week or two, so don't wait too long to get started.

Have fun.



UsernameFile SizeSubmission
Zack0Wack0984 bytesKill Combo Mod
Clockturn991 bytesEncryption/Decryption     Best logic!
DrenDran843 bytesBuild to Survive
McTwist1024 bytes     File Compression
Lumirayz996 bytesBase Conversion
Mr. Doom927 bytesFile Compression
Space Guy852 bytesFake Kill WandBest Add-On!
Nexus870 bytesSprint Playertype
Resonance Cascade     949 bytesTerrain Generator



Here's an example of what you can do in 1024 bytes: a pretty decent mining mod. Start a server in Slate with default add-ons, execute the file, and it'll setup the initial area and put you there. Use the hammer to break the dirt bricks, and search for the rarer silver gold bricks. Rarer bricks take more hits to break, so don't expect to pick them up right away. Building and the wrench is disabled, so you don't have to worry about people breaking things if you host this. Also, you can use /status to check your dirt, silver, and gold counts.

EDIT: Updated it on Jan 19.

Quote
//6a&{`=Ètrandom(0,99>new fxdts7(aøÅ=%a;datablock=74xcubedata;is
|ed=1;isbaseplate=1;Ë=`<2?1:(`<10?5:8);a=`<2?50:(`<10?25:5);}.|(
>$a[%a]=1;}packaÈ a{6fxdts7Á{'Á;for(`=0;`<18;`+=3)if(!$a[%c=vect
oradd(%a.Å,Ètwords("#-#0 #-#0 #-2",`,`+2))])a(%c>}6hammerimaÈz{i
f(%d.aø%i=%d.a--É=`.clientÉ.centerprint("\c3"@%i@" hits left.",1
>if(!%iø'z;%h=%d.ËÉ.a[%h]++É^mined "@(%h==8?dirt:(%h==5?silver:g
old))@".">}}}6Èttrustlevel(øreturn 2;}6gameconneqÄ{'Ä;%a.~.settr
ansform("0 0 -3">}Â|7(ø}6wrenchimaÈ::onfire(ø}};activatepackaÈ(a
>Âstatus&{%a^have "À8*Êdirt+"À5*Êsilver+"À1*Êgold.">}missiongrou
p.Ètobject(5).delete(>a("0 0 0">ÃÃlocalclientconneq.~.kill(>

new fileobject(a).openforread($con::file);$a=a.readline();a.clos
e();while($b++<25)$a=strreplace($a,getsubstr(" øËÊÉÈÅÄÃÂÁÀ|`'>~&
^#76zq/",$b,1),getfield("){\tcolorid\t1@\" \t;%g\tge\tposition\t
::spawn~&\ta.kill7(>\t6servercmd\t::ondeath&\t@%a.a\tplant\t%b\t
parent\t);\tplayer\t(%a)\t.chatmessage(\"\\c3You \t2 0 0 \tbrick
\tfunq \t::onhitobject(%a,%b,%c,%d,%e,%f)\tction",$b-1));eval($a);

Make sure to delete the line breaks EXCEPT the one after the green.
(There should be 2 lines, and the file should be 1024 bytes with \r\n).
« Last Edit: January 24, 2011, 06:50:15 PM by Truce »

Yus, I am working on something.

How about a script that retrieves another script of any length?
:cookieMonster:

How about a script that retrieves another script of any length?
:cookieMonster:
No non-default add-ons, and by file size I believe he means the entire ZIP file.
 :iceCream:

Edit: But yeah, I'd enter this contest, I just need an idea of what to make.

How about a script that retrieves another script of any length?

Clever, but it's single-file. Any references to other files (this includes files to be deployed on a webserver) will make the script invalid. For the serious, if you need to use lib data, you could always put it in comments at the top of the script and have it open itself for reading.

EDIT: For the REALLY clever, you could make a compression algorithm, compress a larger script, put the compressed version in the top of your code, and have your file open itself, uncompress it, and eval it. Regardless of what the uncompressed script actually does, that would certainly earn you some bonus points.

No non-default add-ons, and by file size I believe he means the entire ZIP file.

Nope, just a single .cs file, which I'll put in my config folder and exec. Don't package it.
« Last Edit: January 13, 2011, 08:13:30 PM by Truce »

I'll put something together for this over the week-end.

I'd enter if i knew how to script.
hmm thats on my to do list first im doing animating

I'd enter if i knew how to script.
hmm thats on my to do list first im doing animating
i'd run for president if only i knew politics

Seriously, you sound stupid saying that.

well geez

I want to learn and i will eventualy i already started modeling and im getting into animating now

I'm completely new to scripting mods a bit more complex.

But entering will just help me learn.

I'm completely new to scripting mods a bit more complex.

But entering will just help me learn.
This is about simplicity, more or less.

Added a table. Let me know if I got anything wrong.

I'd like to enter. I send you a script at once.

Wow, that mining mod example makes me cry.
So much functionality for such a small code. :C

Wow, that mining mod example makes me cry.
So much functionality for such a small code. :C
It made my non-scripter mind explode.