You triggered so many bugs with that :)
1)
| > for(array p=({1});;p=(p+({0}))[*]+(({0})+p)[*])write(p[*]+"\n"); | Compiler Error: 1:Bad argument 1 to safe_write. | Compiler Error: 1:Expected: function(string, mixed ... : int) | Compiler Error: 1:Got : function(array(string | mixed | void) : void | mixed)
2)
| > for(array p=({1});;p=(p+({0}))[*]+(({0})+p)[*])write(""+p[*]+"\n"); | Compiler Error: 1:Bad argument 2 to `+. | Compiler Error: 1:Expected: !function(!(object | mixed) ... : mixed) & function | function(int, int ... : int) | !function(!float ... : mixed) & function(int | float, int | float ... : float) | !function(!string ... : mixed) & function(string | int | float, string | int | float ... : string) | function((0=array), (1=array) ... : 0 | 1) | function((0=mapping), (1=mapping) ... : 0 | 1) | function((0=multiset), (1=multiset) ... : 0 | 1) | Compiler Error: 1:Got : function(array(string | mixed | void), string : void | mixed)
3)
after a while, it will (when not run in hilfe) output
| 1 | ... | 67327446062800 | 88749815264600 | 108043253365600^@121548660036300^@1264106064377512154866003630108043253365608874 | 9815264600 ^^ ^^ | 67327446062800 | ...
and other mysterious characters.
(adding devel)
/ Mirar
Previous text:
12785094 2005-01-11 05:48 /11 lines/ Brevbäraren Recipients: Pike (-) importmöte för mailinglistan Subject: challenge: shorter code?
Can anyone make this shorter?
for(array p=({1});;p=(p+({0}))[*]+(({0})+p)[*])write(p[*]+"\n");
--
| Phil Howard KA9WGN | http://linuxhomepage.com/ http://ham.org/ | | (first name) at ipal.net | http://phil.ipal.org/ http://ka9wgn.ham.org/ |
(12785094) /Brevbäraren/--------------------------------------------
pike-devel@lists.lysator.liu.se