Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                .container
  .page-header: h1 ಠ_ಠ Interpreter
  .row
    .col-xs-2
      h2 Code
      textarea.form-control#code(wrap='off')
    .col-xs-5
      h2 Input
      textarea.form-control#input
      br
      button.btn.btn-primary(onclick='output.value=interpret(code.value,input.value)') Run it now! ಠ_ಠ
    .col-xs-5
      h2 Output
      textarea.form-control#output(readonly)
              
            
!

CSS

              
                textarea
  font-family:monospace
              
            
!

JS

              
                String.prototype.repeat||(String.prototype.repeat=function(t){"use strict";if(null==this)throw new TypeError("can't convert "+this+" to object");var r=""+this;if(t=+t,t!=t&&(t=0),0>t)throw new RangeError("repeat count must be non-negative");if(t==1/0)throw new RangeError("repeat count must be less than infinity");if(t=Math.floor(t),0==r.length||0==t)return"";if(r.length*t>=1<<28)throw new RangeError("repeat count must not overflow maximum string size");for(var e="";1==(1&t)&&(e+=r),t>>>=1,0!=t;)r+=r;return e});
var arev=(arr,start,end)=>{while(start<end){var temp=arr[end];arr[end]=arr[start];arr[start]=temp;start++;end--}},
rotate=(array,times)=>{while(times--){var temp=array.shift();array.push(temp)}},
interpret=(c,i='')=>{
  var stack=[],
      code=c.trim().replace(/^ಠ(.+)ಠ$/gm,'$1').split`
`;
  console.clear();
  for(var a=0,x=code[a],z;a<code.length;a++,x=code[a]){
    if(!isNaN(x))stack.push(+x);
    else if(x=='+')stack.push(stack[stack.length-1]+stack[stack.length-2]);
    else if(x=='-')stack.push(stack[stack.length-1]-stack[stack.length-2]);
    else if(x=='*')stack.push(stack[stack.length-1]*stack[stack.length-2]);
    else if(x=='/')stack.push(stack[stack.length-1]/stack[stack.length-2]);
    else if(x=='%')stack.push(stack[stack.length-1]%stack[stack.length-2]);
    else if(x=='_')i.split`
`.map(v=>stack.push(isNaN(v)?v:+v));
    else if(x=='|')stack.push(stack[stack.length-1]);
    else if(x=='$')stack.pop();
    else if(x=='~')stack=[];
    else if(x=='`')arev(stack,stack.length-2,stack.length-1);
    else if(x=='"')arev(stack,stack.length-3,stack.length-1);
    else if(x=='(')rotate(stack,1);
    else if(x==')')rotate(stack,stack.length-1);
    
    else if(x=='=')stack.push(+(stack[stack.length-1]==stack[stack.length-2]));
    else if(x=='>')stack.push(+(stack[stack.length-1]>stack[stack.length-2]));
    else if(x=='?')a=(stack[stack.length-1]?stack[stack.length-2]:stack[stack.length-3])-2;
    else if(x=='@')stack.push(0|Math.random()+.5);
    else if((z=/^\^(.*)$/g.exec(x))!=null)stack.slice()[stack.length-1].split(z[1]).map(v=>stack.push(v));
    else if((z=/^!(.*)$/g.exec(x))!=null)stack.push(stack.join(z[1]));
    else if(x=='益')stack.push('ಠ益ಠ '.repeat(1e5));
    else if(x=='\'')stack.push(stack.length);
    else if(x=='#')a=1/0;
    else stack.push(x);
    console.log(stack);
  }console.log(code);
  return stack[stack.length-1];
}
              
            
!
999px

Console