++++++++++>++++++++++<[->[->+>+<<]>[->>+<<]>[-<<+>>]<<<]>[-]>>>[-<<<+>>>]<<<<,------------------------------------------------>>>>>>++++++++++<,------------------------------------------------>>>>>,------------------------------------------------<<<<<<<<<<[->[->+>+<<]>[->>+<<]>[-<<+>>]<<<]>>>>>[->[->+>+<<]>[->>+<<]>[-<<+>>]<<<]<[->>>>>>+<<<<<<]>>>>>[->+<]>>,>++++++++++>++++++++++<[->[->+>+<<]>[->>+<<]>[-<<+>>]<<<]>[-]>>>[-<<<+>>>]<<<<,------------------------------------------------>>>>>>++++++++++<,------------------------------------------------>>>>>,------------------------------------------------<<<<<<<<<<[->[->+>+<<]>[->>+<<]>[-<<+>>]<<<]>>>>>[->[->+>+<<]>[->>+<<]>[-<<+>>]<<<]<[->>>>>>+<<<<<<]>>>>>[->+<]<<<<<<<<<<<[->>>>>>>>>>>>>+<<<<<<<<<<<<<]>[->>>>>>>>>>>>>>+<<<<<<<<<<<<<<]>>>>>>>>>>>[->>+<<]>>>[->+>+<<]>>[-<<+>>]+<-------------------------------------------[>-]>[-<<<<[->+<]>[->>>>>+<<<<<]>>>>]<<[-]<[->+>+<<]>>[-<<+>>]+<---------------------------------------------[>-]>[-<<<[-<->]<[->>>>>>+<<<<<<]>>>>>]<<[-]<[->+>+<<]>>[-<<+>>]+<------------------------------------------[>-]>[-<<[-]<<[->[->+>+<<]>[->>+<<]>[-<<+>>]<<<]>>>>[->>+<<]>]<<[-]<[->+>+<<]>>[-<<+>>]+<-----------------------------------------------[>-]>[-<<[-]<<[->->[-]+>[-]>+<<<[>-]>[->>>+<[-<<<+>>>]<]<<<]>>>>>[->+<]][-]>[>++++++++++<[->->[-]+>[-]>+<<<[>-]>[->>>+<[-<<<+>>>]<]<<<]>[-]>>>[-<<<<+>>>>]>[-<<<<+>>>>]<<<<<++++++++++++++++++++++++++++++++++++++++++++++++>]<[.<]>
This is a calculator written in Brainf*ck. As you can probably tell, it's somewhat of a challenging language to code in. That's why I wrote
this medium post detailing the entire process of creating this code, including pseudocode and an explaination of how each part works.
love is "/"
violent is "."
agony is ".."
Listen to my benefactor
Your terror wants control
fear is nothing
rock your plaything
while fear is smaller than control without 1
roll control into your soul
rock your plaything with your soul
give your plaything back
my detractor takes my essence
shatter my essence into time with love
rock my life
my will is puzzlement
while my will is weaker than time
let satisfaction be time at my will
if satisfaction is silent or satisfaction is violent
build my will up
take it to the top
if satisfaction is agony
let my life be your terror taking my life
build my will up
take it to the top
rock my life with time at my will
build my will up
unite my life with love
give back love with my life
let my soul be my detractor taking my benefactor
scream my soul
If that "code" looked more like song lyrics... that's the goal! Rockstar is a language designed to mimic the lyrics of hard rock and power ballads. This particular program is a valid solution to
this leetcode problem about simplifying absolute file paths (I felt this language deserved better than just a hello world script). You can learn more about rockstar and how it works
here.
Yup... invisible code. The only valid characters in Whitespace are tabs, spaces, and newlines. Highlight that empty space and you'll see it's not actually empty! This one is just a hello world, but this language was too fun not to include!