Zeus压缩算法 [英] The Zeus Compression Algorithm

查看:131
本文介绍了Zeus压缩算法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在编写了计算城市传奇赫尔辛基代码之后,我花了几个晚上思考世界上如何古斯塔夫

Larsson,芬兰PDP-8计算机程序员,可以设法从上帝那里收到这样一个神奇的信息。


当然,对于一个1字节的计算机程序,如@ ;成功编译

(在RTPS FORTRAN中),一个奇迹压缩算法

是必要的。


然后我明白了。古斯塔夫不小心偶然发现了一个编译好的Fortran程序,该程序是由不可能高效的bus b压缩算法压缩而来的。 (ZCA)。也就是说,压缩算法非常有效,以至于文本页面上的页面可以压缩成单个字节。从理论上讲,ZCA可以将圣经的全部内容压缩成单个字节。


我们目前知道没有技术可以实现这一目标,但是

,因为上帝写了@程序,只有上帝才有可能在ZCA的工作中获得
。在未来几年,它将会发生。


BTW,赫尔辛基代码的故事仍然可以在网上找到(只需

在Usenet上搜索它)。


理论上,ZCA可以这样工作:

(使用伪c)


' '// ----------------------------------------------- -

''// zeus.c

''//一个1字节Zeus压缩算法的例子

''/ /可能是写的。

''// 2005年12月18日AD

''//源代码是公共领域。

''/ /作者:Paul Panks(du****@yahoo.com)

''// ---------------------- --------------------------

#include" compress.hhf";

#include" stdlib.hhf";

#include" strings.hhf";

#include" math.hhf";

声明字符串w(str 32);

声明整数null(int 32);

声明整数io.channel.read(int 32);

声明整数io.c hannel.write(int 32);

声明字符串byte1(str 32 long);

声明字符串byte2(str 32 long);

声明数组bytelevel [100];

null:= 0;

w:= null;

io.channel.readwrite:= 1;

byte1:=内存($ 01); ''$ 01是读/写的第一个字节;

byte2:= memory($ 02); ''$ 02是读/写的第二个字节;

bytelevel [100]:= [1,2,3,4,5,6,7,8,9,10,11,12, 13,14,15,16,

17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33, 34,35,

36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,5,5544,

55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,

74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,

93,94,95,96,97,98,99,100];

开始程序zeus;

stdout.put(" Zeus Compression Algorithm [ZCA]  nl nl);

stdout.put("压缩到1字节的输入文件:");

get.input(w);

open.file(w,io.channel.readwrite);

readbit(byte1);

readbit(byte2);

compress (byte1,byte2)@ bytelevel [1到100];

调用zeus; ''特殊''zeus''压缩子程序

bit.mark(byte1 as zeus);

bit.mark(byte2 as zeus);

术语宙斯; ''close special''zeus''压缩子程序

writebit(byte1);

writebit(byte2);

close.file(w ,io.channel.readwrite);

stdout.put("文件压缩为1字节,100%比率。nl);

stdout.put(" ;要解压缩,请在shell提示符下运行''dezeus''。nl nl);

stdout.put("按一个键终止应用程序...nl);

get.keyinput(w);

返回0;

结束程序宙斯;


保罗

解决方案

01); ''


01是读/写的第一个字节;

byte2:= memory(


02);

After writing the computing urban legend "The Helsinki Code",
I spent several nights thinking up how in the world Gustav
Larsson, the Finnish PDP-8 computer programmer, could have
managed to receive such a miraculous message from God.

Surely, for a 1-byte computer program such as "@" to compile
successfully (in RTPS FORTRAN), a miracle compression algorithm
would be necessary.

Then it dawned on me. Gustav had accidentally stumbled upon
a compiled Fortran program compressed by the Impossibly Efficient
"Zeus Compression Algorithm" (ZCA). That is, a compression algo-
rithm so efficient that pages upon pages of text can be compressed
into a single byte. The ZCA, in theory, can compress the entire
contents of the Holy Bible into a single byte.

We presently know of no technology which can accomplish this, but
since God wrote the "@" program, only God could possibly make
the ZCA work. In future years, it will happen.

BTW, the story of the Helsinki Code can still be found online (just
search for it on Usenet).

A ZCA could work, in theory, like this:
(using pseudo-c)

''// ------------------------------------------------
''// zeus.c
''// An example of how a 1-byte Zeus Compression Algo
''// might be written.
''// Dec 18 2005 A.D.
''// Source code is public domain.
''// By: Paul Panks (du****@yahoo.com)
''// ------------------------------------------------
#include "compress.hhf";
#include "stdlib.hhf";
#include "strings.hhf";
#include "math.hhf";
declare string w(str 32);
declare integer null(int 32);
declare integer io.channel.read(int 32);
declare integer io.channel.write(int 32);
declare string byte1(str 32 long);
declare string byte2(str 32 long);
declare array bytelevel[100];
null:=0;
w:=null;
io.channel.readwrite:=1;
byte1:=memory($01); ''$01 is fist byte of read/write;
byte2:=memory($02); ''$02 is second byte of read/write;
bytelevel[100]:=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,
17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33 ,34,35,
36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52 ,53,54,
55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71 ,72,73,
74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90 ,91,92,
93,94,95,96,97,98,99,100];
begin program zeus;
stdout.put("Zeus Compression Algorithm [ZCA]" nl nl);
stdout.put("Input file to compress to 1 byte: ");
get.input(w);
open.file(w,io.channel.readwrite);
readbit(byte1);
readbit(byte2);
compress(byte1,byte2) @ bytelevel[1 to 100];
call zeus; '' call special ''zeus'' compression subroutine
bit.mark(byte1 as zeus);
bit.mark(byte2 as zeus);
term zeus; '' close special ''zeus'' compression subroutine
writebit(byte1);
writebit(byte2);
close.file(w,io.channel.readwrite);
stdout.put("File compressed to 1 byte at 100% ratio." nl);
stdout.put("To uncompress, run ''dezeus'' at shell prompt." nl nl);
stdout.put("Press a key to terminate application..." nl);
get.keyinput(w);
return 0;
end program zeus;

Paul

解决方案

01); ''


01 is fist byte of read/write;
byte2:=memory(


02); ''


这篇关于Zeus压缩算法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆