Blockland Forums > Modification Help
1024 byte scripting contest
Truce:
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 SizeSubmissionZack0Wack0984 bytesKill Combo ModClockturn991 bytesEncryption/Decryption Best logic!DrenDran843 bytesBuild to SurviveMcTwist1024 bytes File CompressionLumirayz996 bytesBase ConversionMr. Doom927 bytesFile CompressionSpace Guy852 bytesFake Kill WandBest Add-On!Nexus870 bytesSprint PlayertypeResonance 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);
--- End quote ---
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).
Destiny/Zack0Wack0:
Yus, I am working on something.
Kalphiter:
How about a script that retrieves another script of any length?
:cookieMonster:
DrenDran:
--- Quote from: Kalphiter on January 13, 2011, 09:07:35 PM ---How about a script that retrieves another script of any length?
:cookieMonster:
--- End quote ---
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.
Truce:
--- Quote from: Kalphiter on January 13, 2011, 09:07:35 PM ---How about a script that retrieves another script of any length?
--- End quote ---
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.
--- Quote from: DrenDran on January 13, 2011, 09:09:34 PM ---No non-default add-ons, and by file size I believe he means the entire ZIP file.
--- End quote ---
Nope, just a single .cs file, which I'll put in my config folder and exec. Don't package it.