This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| carre(X, Result) :- Result is X * X. | |
| list_carre([X], [XCarre]) :- carre(X, XCarre). | |
| list_carre([X|R], [XCarre| Result1]):- lcarre(R, Result1), carre(X, XCarre). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| is_pair(X) :- Pair is X mod 2, Pair =:= 0. | |
| is_impair(X) :- Impair is X mod 2, Impair =:= 1. | |
| gpair([],[]). | |
| gpair([T|R], [TP|RP]) :- is_pair(T), gpair(R, RP), TP = T. | |
| gpair([T|R], L) :- is_impair(T), gpair(R, L). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| is_pair(X) :- 0 is X mod 2. | |
| is_impair(X) :- not(is_pair(X)). | |
| selec([], [], []). | |
| selec([T|R], [TP|RP], LI) :- is_pair(T), selec(R, RP, LI), TP = T. | |
| selec([T|R], LP, [TI|RI]) :- is_impair(T), selec(R, LP, RI), TI = T. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| arc(b, a, 1). | |
| arc(b, c, 3). | |
| arc(a, d, 4). | |
| arc(c, d, 5). | |
| arc(d, e, 7). | |
| arc(d, f, 6). | |
| ch1(O, D, Longueur) :- arc(O, D, Longueur). | |
| ch1(O, D, Longueur) :- arc(O, N, L0), ch1(N, D, L1), Longueur is L1 + L0. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| % Appel cstl([1,2,3], Y]) % -> Y=[1|[2|[3|[0]]]] | |
| cstl([], Result):- Result = [0]. | |
| cstl([Y|L], Result):- cstl(L, Result1), Result = [Y| Result1]. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Autoload function for PHP. (Compatible PSR-0) | |
| * Use automatic include base on directory | |
| */ | |
| function autoload($className) | |
| { | |
| $className = ltrim($className, '\\'); | |
| $fileName = ''; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| hors_de(X,[Y]):- X\==Y. | |
| hors_de(X,[Y|R]):- X\==Y, hors_de(X,R). | |
| dedans(X,[X]). | |
| dedans(X,[X|_]). | |
| dedans(X,[_|L]):-dedans(X,L). | |
| tous_dif([_]). | |
| tous_dif([X|L]):- hors_de(X,L), tous_dif(L). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| %planche 4 | |
| % | |
| %Exercice 1 | |
| donnee(arbre1, nd(7,nd(5,nd(3,v,v),v), nd(18,nd(9, nd(8,v,v),v),nd(20,v,v)))). | |
| donnee(arbre2, nd(3,v,nd(5,v,v))). | |
| %inv(5,nd(3,v,v),Ar) | |
| %donnee(arbre1, A), inv(12,A,Ar)). | |
| % |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <html> | |
| <head> | |
| <script language="javascript"> | |
| function matrix_on_load() | |
| { | |
| s=window.screen,w=q.width=s.width,h=q.height=s.height,m=Math.random; | |
| // Initialize the number of columns | |
| for(p=[],i=0;i<256;p[i++]=0); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # This snippet suppose the file authors_list exists | |
| # take a look at http://www.yterium.net/Migrer-un-projet-SVN-vers-GIT | |
| if [[ "$1" == "" && "$2" == "" ]] ; then | |
| echo "$1" | |
| echo "$2" | |
| echo "Arguments are invalid" | |
| exit | |
| fi |