June 2018 Update

This commit is contained in:
Ingy döt Net 2018-06-22 20:57:24 +00:00
parent ba8067c3b7
commit 22f33d4004
5278 changed files with 84726 additions and 14379 deletions

View file

@ -1 +1 @@
var a=function () {var b="var a="+a.toString()+"\;a()";alert(b)};a()
q=`%3Bconsole.log(%60q%3D%5C%60%24%7Bq%7D%5C%60%60%2BdecodeURIComponent(q))`;console.log(`q=\`${q}\``+decodeURIComponent(q))

View file

@ -1,5 +1 @@
(function f() {
return '(' + f.toString() + ')();';
})();
var a=function () {var b="var a="+a.toString()+"\;a()";alert(b)};a()

View file

@ -1,5 +1,5 @@
(function f() {
console.log('(' + f.toString() + ')();');
return '(' + f.toString() + ')();';
})();

View file

@ -0,0 +1,5 @@
(function f() {
console.log('(' + f.toString() + ')();');
})();

View file

@ -1,7 +1 @@
function quine()
fid = fopen([mfilename,'.m']);
while ~feof(fid)
printf('%s\n',fgetl(fid));
end;
fclose(fid);
end;
x='{>\(y>(((-y-(((<(^<ejtq)\{-y.2^*<';z=['x=''',x,''';'];disp([z,x-1]);

View file

@ -1,3 +1,7 @@
function quine()
type(mfilename);
fid = fopen([mfilename,'.m']);
while ~feof(fid)
printf('%s\n',fgetl(fid));
end;
fclose(fid);
end;

View file

@ -1 +1,3 @@
function quine; y = 'function quine; y = %c%s%c; fprintf(1, y, 39, y, 39)\n'; fprintf(1, y, 39, y, 39)
function quine()
type(mfilename);
end;

View file

@ -0,0 +1 @@
function quine; y = 'function quine; y = %c%s%c; fprintf(1, y, 39, y, 39)\n'; fprintf(1, y, 39, y, 39)

View file

@ -1,2 +1,2 @@
x = 'x = %r\nprint(x %% x)'
print(x % x)
w = "print('w = ' + chr(34) + w + chr(34) + chr(10) + w)"
print('w = ' + chr(34) + w + chr(34) + chr(10) + w)

View file

@ -1,3 +1,3 @@
a = 'YSA9ICcnCmIgPSBhLmRlY29kZSgnYmFzZTY0JykKcHJpbnQgYls6NV0rYStiWzU6XQ=='
b = a.decode('base64')
print b[:5]+a+b[5:]
x = """x = {0}{1}{0}
print x.format(chr(34)*3,x)"""
print x.format(chr(34)*3,x)

View file

@ -1,7 +1,3 @@
data = (
'ZGF0YSA9ICgKCSc=',
'JywKCSc=',
'JwopCnByZWZpeCwgc2VwYXJhdG9yLCBzdWZmaXggPSAoZC5kZWNvZGUoJ2Jhc2U2NCcpIGZvciBkIGluIGRhdGEpCnByaW50IHByZWZpeCArIGRhdGFbMF0gKyBzZXBhcmF0b3IgKyBkYXRhWzFdICsgc2VwYXJhdG9yICsgZGF0YVsyXSArIHN1ZmZpeA=='
)
prefix, separator, suffix = (d.decode('base64') for d in data)
print prefix + data[0] + separator + data[1] + separator + data[2] + suffix
a = 'YSA9ICcnCmIgPSBhLmRlY29kZSgnYmFzZTY0JykKcHJpbnQgYls6NV0rYStiWzU6XQ=='
b = a.decode('base64')
print b[:5]+a+b[5:]

View file

@ -1,5 +1,7 @@
def applyToOwnSourceCode(functionBody):
print "def applyToOwnSourceCode(functionBody):"
print functionBody
print "applyToOwnSourceCode(" + repr(functionBody) + ")"
applyToOwnSourceCode('\tprint "def applyToOwnSourceCode(functionBody):"\n\tprint functionBody\n\tprint "applyToOwnSourceCode(" + repr(functionBody) + ")"')
data = (
'ZGF0YSA9ICgKCSc=',
'JywKCSc=',
'JwopCnByZWZpeCwgc2VwYXJhdG9yLCBzdWZmaXggPSAoZC5kZWNvZGUoJ2Jhc2U2NCcpIGZvciBkIGluIGRhdGEpCnByaW50IHByZWZpeCArIGRhdGFbMF0gKyBzZXBhcmF0b3IgKyBkYXRhWzFdICsgc2VwYXJhdG9yICsgZGF0YVsyXSArIHN1ZmZpeA=='
)
prefix, separator, suffix = (d.decode('base64') for d in data)
print prefix + data[0] + separator + data[1] + separator + data[2] + suffix

View file

@ -0,0 +1,5 @@
def applyToOwnSourceCode(functionBody):
print "def applyToOwnSourceCode(functionBody):"
print functionBody
print "applyToOwnSourceCode(" + repr(functionBody) + ")"
applyToOwnSourceCode('\tprint "def applyToOwnSourceCode(functionBody):"\n\tprint functionBody\n\tprint "applyToOwnSourceCode(" + repr(functionBody) + ")"')

View file

@ -1 +1,2 @@
x = 'x = {!r};print(x.format(x))';print(x.format(x))
x = 'x = %r\nprint(x %% x)'
print(x % x)

View file

@ -1 +1 @@
import sys; sys.stdout.write(open(sys.argv[0]).read())
x = 'x = {!r};print(x.format(x))';print(x.format(x))

View file

@ -1 +1 @@
import sys,inspect;sys.stdout.write(inspect.getsource(inspect.currentframe()))
import sys; sys.stdout.write(open(sys.argv[0]).read())

View file

@ -1 +1 @@
print(__file__[:-3])
import sys,inspect;sys.stdout.write(inspect.getsource(inspect.currentframe()))

View file

@ -1,2 +1 @@
$ python print\(__file__\[\:-3\]\).py
print(__file__[:-3])

View file

@ -1,4 +1,2 @@
$ cat print\(__file__\)
print(__file__)
$ python print\(__file__\)
print(__file__)
$ python print\(__file__\[\:-3\]\).py
print(__file__[:-3])

View file

@ -1,11 +1,4 @@
$ cat reproducing.py
File "reproducing.py", line 1
File "reproducing.py", line 1
^
IndentationError: unexpected indent
$ python reproducing.py
File "reproducing.py", line 1
File "reproducing.py", line 1
^
IndentationError: unexpected indent
$ cat print\(__file__\)
print(__file__)
$ python print\(__file__\)
print(__file__)

View file

@ -1,3 +1,11 @@
x = """x = {0}{1}{0}
print x.format(chr(34)*3,x)"""
print x.format(chr(34)*3,x)
$ cat reproducing.py
File "reproducing.py", line 1
File "reproducing.py", line 1
^
IndentationError: unexpected indent
$ python reproducing.py
File "reproducing.py", line 1
File "reproducing.py", line 1
^
IndentationError: unexpected indent

View file

@ -1 +1 @@
/*REXX program outputs itself.*/ do j=1 for sourceline(); say sourceline(j); end
/*REXX program outputs its own 1─line source.*/ say sourceline(1)

View file

@ -1,4 +1,5 @@
/*REXX program outputs its own source including comments and blank lines.*/
do k=1 for sourceline()
say sourceline(k)
end /*k*/
/*REXX program outputs its own multi─line source.*/
do j=1 for sourceline()
say sourceline(j)
end /*j*/

View file

@ -0,0 +1,42 @@
fn main(){let q:&[u8]=&[
32,00,00,00,00,00,00,00,61,27,80,82,
73,78,84,76,78,01,08,02,91,93,70,78,00,77,65,73,78,08,
09,91,91,76,69,84,00,81,26,06,59,85,24,61,29,06,59,02,12,00,51,84,
82,73,78,71,26,26,70,82,79,77,63,85,84,70,24,08,86,69,67,01,59,66,07,00,
07,27,00,21,20,61,09,14,85,78,87,82,65,80,08,09,09,27,76,69,84,00,82,29,08,81,
14,76,69,78,08,09,65,83,00,70,22,20,15,83,84,68,26,26,70,22,20,32,00,00,00,00,00,00,00,00,
00,26,26,67,79,78,83,84,83,26,26,48,41,09,14,83,81,82,84,08,09,65,83,00,73,19,18,11,20,27,76,69,
84,00,77,85,84,00,66,26,00,54,69,67,28,08,73,19,18,12,00,73,19,18,09,00,30,29,00,54,69,67,26,26,
78,69,87,08,09,27,00,15,10,00,00,00,79,79,69,82,00,00,10,15,00,76,69,84,00,77,85,84,00,88,29,82,13,17,
27,00,76,69,84,00,77,85,84,00,89,29,16,27,32,00,00,00,00,00,00,00,00,00,00,76,69,84,00,77,85,84,00,75,29,17,
27,76,69,84,00,77,85,84,00,74,29,17,27,76,69,84,00,77,85,84,00,69,29,75,00,13,08,82,28,28,17,09,27,87,72,73,76,69,
00,88,30,29,89,91,66,14,80,85,83,72,08,08,82,11,88,12,82,11,89,09,09,27,66,14,80,85,83,72,08,08,82,11,89,12,82,11,
88,09,09,27,00,66,14,80,85,83,72,08,08,82,13,89,12,82,11,88,09,32,00,00,00,00,00,00,00,00,00,00,00,00,00,09,27,66,14,80,
85,83,72,08,08,82,13,88,12,00,82,11,89,09,09,27,66,14,80,85,83,72,08,08,82,13,88,12,82,13,89,09,09,27,66,14,80,85,83,72,
08,08,82,13,89,12,82,13,88,09,09,27,00,66,14,80,85,83,72,08,08,82,11,89,12,82,13,88,09,09,27,66,14,80,85,83,72,08,08,82,
11,88,12,82,13,89,09,09,27,00,73,70,00,69,28,29,16,91,32,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,89,11,29,17,27,69,11,
29,74,27,74,11,29,18,27,93,73,70,00,69,30,16,00,91,88,13,29,17,27,75,11,29,18,27,69,11,29,75,13,08,82,28,28,17,09,27,93,93,76,
69,84,00,77,85,84,00,84,29,81,14,73,84,69,82,08,09,27,07,79,26,70,79,82,00,89,00,73,78,00,17,14,14,82,10,18,00,91,00,76,69,84,
00,76,26,00,54,69,67,32,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,28,73,19,18,30,00,29,00,66,14,73,84,69,82,08,
09,14,70,73,76,84,69,82,08,92,88,92,00,88,14,17,29,29,89,09,14,77,65,80,08,92,88,92,00,88,14,16,09,14,67,79,76,76,69,67,84,08,
09,27,00,76,69,84,00,88,00,29,00,76,14,73,84,69,82,08,09,14,67,76,79,78,69,68,08,09,14,70,79,76,68,08,16,12,32,00,00,00,00,00,
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,73,19,18,26,26,77,65,88,09,27,00,76,69,84,00,78,00,29,76,14,73,84,69,82,08,09,
14,67,76,79,78,69,68,08,09,14,70,79,76,68,08,25,25,25,12,00,73,19,18,26,26,77,73,78,09,27,76,69,84,00,77,29,88,13,78,27,00,70,
79,82,00,63,00,73,78,00,16,14,14,78,00,91,00,80,82,73,78,84,01,32,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,
00,00,00,00,08,02,00,00,00,02,09,27,93,70,79,82,00,63,00,73,78,00,16,14,14,77,91,00,73,70,00,76,69,84,00,51,79,77,69,08,86,09,
00,29,00,84,14,78,69,88,84,08,09,00,91,80,82,73,78,84,01,08,02,91,26,16,18,93,12,02,12,86,09,27,93,00,69,76,83,69,91,00,66,82,
69,65,75,32,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,07,79,27,00,93,93,00,80,82,73,
78,84,01,08,02,60,78,02,09,27,00,93,00,70,79,82,00,78,00,73,78,00,81,14,73,84,69,82,08,09,00,91,00,80,82,73,78,84,01,08,02,91,
93,02,12,00,08,73,70,00,10,78,29,29,19,18,91,17,16,93,00,69,76,83,69,32,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,91,10,78,11,19,18,93,09,00,65,83,00,67,72,65,82,09,27,93,80,82,73,
78,84,01,08,02,60,78,02,09,27,93,00,15,15,00,71,73,84,72,85,66,14,67,79,77,15,75,73,82,74,65,86,65,83,67,82,73,80,84,
];println!("{}fn main(){{let q:&[u8]=&[", String::from_utf8(vec![b' '; 54]).unwrap());let r=(q.len()as f64/std::f64
::consts::PI).sqrt()as i32+4;let mut b: Vec<(i32, i32) >= Vec::new(); /* ooer */ let mut x=r-1; let mut y=0;
let mut k=1;let mut j=1;let mut e=k -(r<<1);while x>=y{b.push((r+x,r+y));b.push((r+y,r+x)); b.push((r-y,r+x)
);b.push((r-x, r+y));b.push((r-x,r-y));b.push((r-y,r-x)); b.push((r+y,r-x));b.push((r+x,r-y)); if e<=0{
y+=1;e+=j;j+=2;}if e>0 {x-=1;k+=2;e+=k-(r<<1);}}let mut t=q.iter();'o:for y in 1..r*2 { let l: Vec
<i32> = b.iter().filter(|x| x.1==y).map(|x| x.0).collect(); let x = l.iter().cloned().fold(0,
i32::max); let n =l.iter().cloned().fold(999, i32::min);let m=x-n; for _ in 0..n { print!
(" ");}for _ in 0..m{ if let Some(v) = t.next() {print!("{:02},",v);} else{ break
'o; }} print!("\n"); } for n in q.iter() { print!("{}", (if *n==32{10} else
{*n+32}) as char);}print!("\n");} // github.com/kirjavascript