4 languages that can kill themselves
4 files, each with a different language. Each file will call the next file, and then commit die. Like this:
**main.cpp** run main.py kill itself **main.py** run main.rb kill itself etc.
Basically how this works is each file calls 2 shell commands, one to run the next file, and one to commit toaster bath. The bash command to commit skydiving without a parachute is rm FILE_NAME
.
I also added brief comments on how the shell commands work in each language so you might learn something.
I'm just bored.
Looks like a being more powerful than Thanos, one that did the job right this time.
@SwaroopBappanad What about the rest of the Repls?
@xxpertHacker I meant the thing as a whole
@SwaroopBappanad Yeah he is right lol
@xxpertHacker they committed ziplining without a harness duh
Two thumbs up.
@HiPeople844 thank you!
@DynamicSquid what does it do tho
@HiPeople844 it commits unalive, run the code, and all the files will self destruct
@HiPeople844 like SixBeeps said:
This is unbelievably useless and I love it
@DynamicSquid hmm ok
Are you available to help me with something? @DynamicSquid
@MohammedBalsara sure what's up?
Can you help me make a language? @DynamicSquid
@MohammedBalsara oh, sorry no. I'm really busy myself. I can point you to the right direction though
alr, tell me more. @DynamicSquid
@MohammedBalsara Okay, try to make a lexer first. A lexer takes in a string input, and turns that into a list of "tokens". A token is a class which has a type, and the actual token.
For example:
(you do python right?)
class Token: def __init__(self, type, value): self.type = type self.value = value def lexer(code): # implement your lexer here # it should return a list of tokens code = input() tokens = lexer(code) # make sure it works for token in tokens: print('[' + token.value + ']', end=' ')
A token might look like this:
token = Token('value', '5') token = Token('value', 'true') token = Token('operator', '+')
Right now, you can start small and only focus on arithmetic operations. You want your code to take in input like:
3 * (21 + 4)
And print this:
[3] [*] [(] [21] [+] [4] [)]
alr thanks @DynamicSquid
so basically the file opens a new file then commits lego step..... truly the best use of technology what a genius
@SeamusDonahue thank you!!
@SeamusDonahue Lego step! How did I forget‽
this made me learn C++ lol
This is insanity
@DynamicSquid yay congrats on 3100 cycles. Go beat coder for me thanks
=D I suck at making memes @DynamicSquid
I've thought of doing this before. You just have to make sure you commit a snapshot before the program commits. @DynamicSquid
@ike_fite :)
This is the kind of useless nonsense we need more of!
@JohnsonAndrew yup lol!
Yo squid you forgot one. :)
@LAMAQDAHODWALA lol! nice one :)
very much a c way of doing things but ok
lol!
Dynamic Squid: Creates repl that commits sudoku
Literally everyone: SMASHES UPVOTE
@DynamicSquid all jokes aside, its a pretty good project
@SwaroopBappanad oh thank you!!
i fell like this could be a movie called "Self Destruct" where one thing causes itself and another things to explode etc...
@ridark lol!
btw this is incredible nonsense, it epic @DynamicSquid
"commit die" "commit toaster bath" "commit skydiving without a parachute" "commit unalive" BWAHAHAHAHAHAHAHAHA
@DynamicSquid We need more!
@RahulChoubey1 Yes! We need more! @DynamicSquid
@maxyang MOAR COMMITZ
It's useless...
BUT IT'S TOO GOOD!!!!!!!!!
@RayvelArjoon lol thanks!!
I can't stop running the program and reloading the page. Help!
its makes me feel exciting
@MkDeon lol!
@PattanAhmed lol it's not that hard
@PattanAhmed , it is actually really simple, all you have to do is go to the console or shell and type in rm [insert file name here]
.
@DynamicSquid I know!
But...
@AbhayBhat Yes
Thanks for your answer!
@PattanAhmed @DynamicSquid It's funny how repl's filesystem freaks out if the main file deletes itself and you then try to edit other files.
@fuzzyastrocat LoL!
Good point!
It's pretty good, but it would be cool if you could use a way to delete the files that's not the terminal, maybe os.remove() for Python (https://docs.python.org/3/library/os.html) or the file.delete command in Ruby (https://arjunphp.com/delete-file-ruby#:~:text=Removing%20single%20file%20in%20Ruby,of%20names%20passed%20as%20arguments.) Just a suggestion for in the future though, because this does its function perfectly.
Now I know what to say when I don't turn in CS assignments
@PXY lol yeah!
"Why didn't you do your homework?"
"My code self-destructed"
@DynamicSquid "Thanks for telling me! I'll be sure to mark your grade accordingly."
So dumb, yet so smart. life in a nutshell
I'm just glad no has created real life anime characters...
wow, files disappear lol!
(mac users commit cmd-Q
lol)
i love this and the code is too complex for me to understand also what is your fav icecream flavor?
@python88 my favourite ice cream flavour is success
@python88 what's yours?
@DynamicSquid vanila javascript with a litle bit of umm... idk
@python88 with a bit of nodejs?
@DynamicSquid also drop a gallon of python eyes
@DynamicSquid and some ruby diamonds
@DynamicSquid with C - weed
@python88 I call it "ink" from where I come from
@DynamicSquid your the first squid to get 3000 cycles and the 5th place
@DynamicSquid do you like coffie-script
@python88 I hate all flavours of js
@python88 oh sorry, I mistyped
@DynamicSquid well bye mr or ms squuid
This is absurdly daft and wonderful, wish I thought of it first.... I know the story of a man who though killing a process could be done by delete it's source program. No. Also C++ is compiled to main (the elf binary) with clang so instead of rm main.cpp
do rm main.cpp main
. There is still that cheeky main file still there.
@firefish well only if you compile it yourself. the default repl.it project contains the main.cpp
@DynamicSquid repl.it purposely hides the file called "main". do an ls -la
in the bash shell
@firefish oh, I didn't know that
@DynamicSquid REmember: c++ is not a script, it is a compile lang, so the binary has to go somewhere
@firefish yeah I know that, but I thought the main
file was unaccessable
@DynamicSquid It exists, just the repl.it file manager hides it from you
awesome
@python88 Thank you!!
HAHA
lmao this is hilarious
@DannyIsCoding lol yeah!
wait..wat?..why are..wt...this is...
This is unbelievably useless and I love it
@SixBeeps thank you!!
@SixBeeps My mom went to case western too!
(It says in his bios)
@techde nice