Re: Extended DCG? 8cD
"Abdallah, Samer" <[email protected]>
| Newsgroups | gmane.comp.ai.prolog.swi |
|---|---|
| Message-ID | <[email protected]> |
ow ow - enough already. I surrender!
Samer.
On 13 Feb 2014, at 19:13, Anne Ogborn wrote:
>
> Blimey, did you do all of that in a couple of hours, or had you already
> spent time and effort on it? :)
>
>
> Samer.
>
> Check the last commit date! 5 months ago.
>
> In case you want a command line version:
>
> https://github.com/Anniepoo/prolog-examples/blob/master/emoticons.pl
>
>
> 8cD 8cD 8cD 8cD 8cD 8cD 8cD 8cD 8cD 8cD 8cD 8cD 8cD 8cD 8cD
>
> :x/ =8cO =8cK
>
> More smiley madness below!
> (also available in pack_install(evil) if the unicode doesn't make it thru the mail system)
> (not tested on 7+ versions)
>
>
> :- module('()))', ['(((('/1,
> ☺ /1,
> '8c)'/2,
> ':c['/2]).
> /** <module> ()))
>
>
>
> ==
> || ||
> ||---m |
> (--) / )\/\
> / (8c)/_______)
> / v--v
> ---------------------------------
> < ¡ooWooW ¡ooOOOoooOOoɯ ¡ooW ¡OOW >
>
>
> ==
>
> @author 8cD Yup!
> @see https://github.com/wouterbeek/PrologGenericsCollection/blob/master/DCG/emoticons.pl
>
> */
> :- ensure_loaded(evil).
>
> :- thread_local लक्ष्य/1.
>
> d :- license(wtfpl).
>
> '=8cO'(X) :- meta_predicate(X). % 8cD
> :- '=8cO'('=8cO'(:)).
>
> p :- style_check(-singleton).
>
> :- '=8cO'('8c)'(+, 0)).
>
> %%'8c)'(+Ⱦकुल:atom, :Ⱦकाम:लक्ष्य)is nondet
> %
> %छोटे लक्ष्य सुरक्षित है भरोसा दिलाते
> %
> '8c)'(Ⱦकुल, Ⱦकाम) :-
> setup_call_cleanup(
> asserta(लक्ष्य(Ⱦकुल)),
> call(Ⱦकाम),
> retract(लक्ष्य(Ⱦकुल))
> ).
>
> ☺( ☺ ).
> ☺(moo).
>
>
> :- '=8cO'(':c['(+, 0)).
>
> :-p.
>
> %%':c['(+Ⱦकुल:atom, :Ⱦकाम:लक्ष्य)is nondet
> %
> %इस छोटे से लक्ष्य को सुरक्षित है कि आवश्यकता
> %
> ':c['(Ⱦकुल, Ⱦकाम) :-
> लक्ष्य(Ⱦकुल),!,
> call(Ⱦकाम).
> ':c['(Ⱦकुल, Ⱦकाम) :-
> format(atom(Ƨ),
> 'आप ~q की अनुमति नहीं है जब आप ~w बुला रहे हैं किस कारण से',
> [ Ⱦकाम, Ⱦकुल]),
> throw(error(':c[',
> context(':c['/2, Ƨ ))).
>
> %%'(((('(+__: + ) is det
> %
> %local definition =8c.
> %
> '(((('(__) :-
> writeln(__).
>
> %%Unit tests! =8cD
> %
> :- thread_local('-C:^{['/2).
>
> '8cD' :- '-C:^{['(_, _),
> writeln('*8cD').
>
> '*8cD' :- ':c['(ǝıuuɐ_ʇɔǝʇoɹd, '8cD').
>
> '-C:^{['(X) :-
> ☺(moo),
> asserta('-C:^{['('8cD','*8cD')),
> '8c)'(ǝıuuɐ_ʇɔǝʇoɹd, X),
> retractall('-C:^{['(_, _)).
>
> test :- '-C:^{['('*8cD').
>
> :-d.
>
_______________________________________________
SWI-Prolog mailing list
[email protected]
https://lists.iai.uni-bonn.de/mailman/listinfo.cgi/swi-prolog