Category : Miscellaneous Language Source Code
Archive   : PROLOG19.ZIP
Filename : BENCH.PRO

 
Output of file : BENCH.PRO contained in archive : PROLOG19.ZIP
/*
Concatentate strings, using append. If the below is asked,

?-append( "ABC", "DEF", X ), append( "123", X, Y ), append( Y, "XYZ", Z ),
printstring( Z ).

you will get: Z = "123ABCDEFXYX", printed out as a list of ASCII codes. */

append( [], L, L ).
append( [Z|L1], L2, [Z|L3] ) :- append( L1, L2, L3 ).
printstring( [] ).
printstring( [H|T] ) :- put( H ), printstring( T ).


lips(L) :- rev( [1,2,3,4,5,6,7,8,9,0,11,12,13,14,15,16,17,18,19,20,
21,22,23,24,25,26,27,28,29,30], L ).


lip(L) :- rev( [1,2,3,4], L ).

l(L) :- rev( [1,2], L ).

l1(L) :- rev( [1], L ).

rev( [], [] ).
rev( [H|T], L ) :- rev( T,Z), append( Z, [H], L ).


  3 Responses to “Category : Miscellaneous Language Source Code
Archive   : PROLOG19.ZIP
Filename : BENCH.PRO

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/