(thanks bomb bloke for the gif)
One thing I have learned from these forums is CC users love viruses and pranks. Sadly malicious code is not allowed on here ;)/> nor is it really that possible in a sandboxed environment like this one. So now I present to you the next best thing! A game which lets you harmlessly vent your frustrations as you crush other programs in a virtual arena!
The gladiatorial arena features a semi sandboxed environment with an arbitrary file system. Instead of having file names all programs are stored in "blocks" which are numbered 1 to the size of the arena. Not even a program by default knows what its own location is. The functions for competing are simple and the goal even simpler. Be the last virus standing amongst the digital blood bath
fs.open(block,type)
block must always be a number and less than the size of the arena. the type is either "w" for write or "r" for read. However, this wouldn't be a game without a few catchescatches
- if you try to write to an existing file your program will crash
- if you try to open a file which has been deleted your program will crash
- will sleep for 2 ticks to read and 4 ticks to write (remember speed is key in this)
fs.check(block)
returns -1 if a block has been deleted. 0 if a block is empty. and 1 if the block has a file in it currently (can't make this return something easy can I?catches
- block cant be larger than the arena size
- sleeps for 2 ticks
fs.delete(block)
deletes a block. pretty straight forwardcatches
- if the file is already deleted will error
- sleeps for 2 ticks if the file was empty
- sleeps for 4 ticks if there was a file in that block
fs.create(block)
creates a new block within the size of the arenacatches
- if the block already exists will error
- will sleep for 4 ticks
fs.size()
returns the size of the arena. No catches and no sleeps.
fs.resetTimer(string)
Your most important function! A program must call this at least once every 10 seconds or they lose. to call it simply pass your programs original file name as a string no sleep in this either so if you can call it you may as wellUSAGE:
arena size virus1 virus2
example
arena 1000 limbo abyss
Thanks for reading!