Gibberish/JavaScript

From Esolang
Jump to: navigation, search
This article is a stub, which means that it is not detailed enough and needs to be expanded. Please help us by adding some more information.

Gibberish/JavaScript is a Gibberish derivative.

Escape sequence

See also completed list

escape sequence output output’s ASCII code
$h backspace 8
$_ newline 10
$e escape 27
$( { 123
$) } 125
$[ < 60
$] > 62
$! | 124
$$ $ 36
$p % 37
$a & 38
$q = 61
$' " 34
$` ^ 94
$s space 32
$/ \ 92
$x8F unicode character U+008F 143
${calc:0:1+2*3}${get:0} 7 55

Example

Comment

${: anything}

Concatenate string program

${cat:}

Hello, World!

A "Hello, World!" program and quine:

Hello, World!

A slightly more elaborate "Hello, world!":

${echo:Hello, World!}
${alert:Hello, World!}

palindrome version:

Hello, World!${:{$!dlroW ,olleH
              }:}
${set:teg}${calc:tes:"Hello, World!"//"!dlroW ,olleH":set:clac}${get:tes}$

99 bottles of beer

${calc:0:
var a = " bottle";
var b = " of beer";
var c = " on the wall";
var d = "Take one down, pass it around,\n";
for(var e = 99, f = ""; e > 1; --e) {
  f += e + a + "s" + b + c + ",\n";
  f += e + a + "s" + b + ".\n";
  f += d;
  f += e - 1 + a + "s" + b + c + ".\n\n";
}
}${get:0}$
1 bottle of beer on the wall,
1 bottle of beer
Take one down, pass it around,
No bottles of beer on the wall.

Quine

${calc:0:(function(a,b){return a+String.fromCharCode(34)+a+String.fromCharCode(34,44,34)+b+String.fromCharCode(34)+b})("${calc:0:(function(a,b){return a+String.fromCharCode(34)+a+String.fromCharCode(34,44,34)+b+String.fromCharCode(34)+b})(",")}${get:0}")}${get:0}
${calc:0:"${calc:0:#@#.replace(/#@#/,unescape('%22$`$&$%27%22'))}${get:0}".replace(/#@#/,unescape('%22$`$&$%27%22'))}${get:0}

and shorter:

${recurcall:$${recurcall:$0}}

self interpreter

${calc:0:prompt("Input:")}${getf:0}

Fibonacci sequence

${calc:0:var a=0,b=1,c="",e;for(var d=0;d<60;++d){c+=b+" ";e=a+b;a=b;b=e}c}${get:0}

asterisks counter

${recurcall:$${recurcall:$0}$$@1$$;*}$@1$;

Oscillator

period 2:

${calc:0:(function(a,b,c,d){return a+String.fromCharCode(39)+b+String.fromCharCode(34)+a+String.fromCharCode(34,44,34)+b+String.fromCharCode(34,44,34)+c+String.fromCharCode(34,44,34)+d+String.fromCharCode(34)+c+String.fromCharCode(39)+d})("${calc:0:(","${calc:0:(function(a,b,c,d){return a+String.fromCharCode(39)+b+String.fromCharCode(34)+a+String.fromCharCode(34,44,34)+b+String.fromCharCode(34,44,34)+c+String.fromCharCode(34,44,34)+d+String.fromCharCode(34)+c+String.fromCharCode(39)+d})(",")}${get:0}$@1$;",")}${get:0}$@1$;")}${get:0}$@1$;
${recurcall:$${echo:$${recurcall:$0}$$@1$$;}$$@1$$;}$@1$;

See also