Download code

Jump to: navigation, search

Back to Quine_(Erlang)

Download for Windows: zip

Download for UNIX: zip, tar.gz, tar.bz2

quine.erl

 1 % The authors of this work have released all rights to it and placed it
 2 % in the public domain under the Creative Commons CC0 1.0 waiver
 3 % (http://creativecommons.org/publicdomain/zero/1.0/).
 4 % 
 5 % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 6 % EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 7 % MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 8 % IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
 9 % CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
10 % TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
11 % SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
12 % 
13 % Retrieved from: http://en.literateprograms.org/Quine_(Erlang)?oldid=4739
14 
15 -module(quine).
16 -export([start/0]).
17 
18 start() ->
19     Data = data(),
20     io:format("~s~n~ndata() ->~n    ~w.~n", [Data, Data]),
21     halt().
22 
23 data() ->
24     [45,109,111,100,117,108,101,40,113,117,105,110,101,41,46,10,45,101,120,112,111,114,116,40,91,115,116,97,114,116,47,48,93,41,46,10,10,115,116,97,114,116,40,41,32,45,62,10,32,32,32,32,68,97,116,97,32,61,32,100,97,116,97,40,41,44,10,32,32,32,32,105,111,58,102,111,114,109,97,116,40,34,126,115,126,110,126,110,100,97,116,97,40,41,32,45,62,126,110,32,32,32,32,126,119,46,126,110,34,44,32,91,68,97,116,97,44,32,68,97,116,97,93,41,44,10,32,32,32,32,104,97,108,116,40,41,46].
25 


hijacker
hijacker
hijacker
hijacker

quine2.erl

 1 % The authors of this work have released all rights to it and placed it
 2 % in the public domain under the Creative Commons CC0 1.0 waiver
 3 % (http://creativecommons.org/publicdomain/zero/1.0/).
 4 % 
 5 % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 6 % EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 7 % MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 8 % IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
 9 % CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
10 % TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
11 % SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
12 % 
13 % Retrieved from: http://en.literateprograms.org/Quine_(Erlang)?oldid=4739
14 
15 -module(quine2).
16 -export([start/0]).
17 
18 quine(Source) -> 
19     io:format(Source ++ [$(,34] ++ Source ++ [34,$),$.]),
20     halt().
21     
22 start() ->
23     quine("-module(quine2).
24 -export([start/0]).
25 
26 quine(Source) -> 
27     io:format(Source ++ [$(,34] ++ Source ++ [34,$),$.]),
28     halt().
29     
30 start() ->
31     quine").


hijacker
hijacker
hijacker
hijacker