Skip to content

Commit

Permalink
ajustes
Browse files Browse the repository at this point in the history
  • Loading branch information
claudiosa committed Jul 24, 2018
2 parents 26242a2 + abc0d96 commit 4292975
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 3 deletions.
27 changes: 27 additions & 0 deletions picat/cidades_estradas.pi
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@

%%% FATOS ... = Mapa
index(-, -)
estrada(joinville , itajai ) .
estrada(joinville , blumenau ) .
estrada(itajai , camboriu ) .
estrada(blumenau , camboriu ) .
estrada(camboriu , floripa ) .

% As regra da LPO agora em PICAT
%% MUDAR AQUI .....
caminho(X,Y) ?=> estrada(X,Y) .
caminho(X,Y) => estrada(X,Z) ,
caminho(Z,Y) .

listar_todos ?=> %%% this rule is backtrackable
caminho(X,Y) , %% and
printf("\n X: %w ---> Y: %w ", X, Y ) , %% and
false.

listar_todos =>
printf("\n ") ,
true. %% the final rule of above

%% aconselhavel o ... uso do main
main =>
listar_todos .
9 changes: 9 additions & 0 deletions picat/contest_LP_CP/stars.pi
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
main([File]) =>
As = read_file_terms(File),
<<<<<<< HEAD
printf("solution(%d)\n", stars_P(As)).
=======
printf("solution(%d)", stars_P(As)).
>>>>>>> abc0d96c2ad5d2a370774b173ecfb23bf8dd193b


stars_P(FACTS) = Bright =>
Expand All @@ -23,8 +27,13 @@ main([File]) =>
Bright := 0,
%%% $ filter
%write(L_star),
<<<<<<< HEAD
foreach ($star(_,X,Y,B) in L_star ) %%% interessante o uso do $ eh um filtro
if ( (X <= W) && (Y <= H) ) then
=======
foreach ($star(_,X,Y,B) in L_star) %%% interessante o uso do $ eh um filtro
if ((X <= W) && (Y <= H)) then
>>>>>>> abc0d96c2ad5d2a370774b173ecfb23bf8dd193b
Bright := Bright + B
end
end.
Expand Down
6 changes: 6 additions & 0 deletions picat/geany_conf_PICAT/install_conf_PICAT_geany.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Install syntax highlighting of Picat in Geany editor :

<<<<<<< HEAD
FOR LINUX and UNIX:

1. COPY filetype_extensions.conf TO ~USER_HOME/.config/geany/
Expand All @@ -11,3 +12,8 @@ FOR WINDOWS:
1. copy filetype_extensions.conf c:\Users\nzhou\AppData\Roaming\geany\
2. copy filetypes.Picat.conf c:\Users\nzhou\AppData\Roaming\geany\filedefs\
3. Reinitialize the Geany and fun !
=======
1. COPY filetype_extensions.conf TO ~USER_HOME/.config/geany/
2. COPY filetypes.Picat.conf TO ~USER_HOME/.config/geany/filedefs/
3. Reinitialize the Geany and fun !
>>>>>>> abc0d96c2ad5d2a370774b173ecfb23bf8dd193b
4 changes: 1 addition & 3 deletions picat/regras_ex_01.pi
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ homem ( socrates ) .
homem ( adao ) .
%%% opcional
main => listar_todos.


%% Uma regra da LPO:
%% Uma regra da LPO (logica de 1a ordem):
%% Todos homens sao mortais
%%:: Qx ( homem(x) --> mortal(x))
mortal(X) => homem(X) .
Expand Down
12 changes: 12 additions & 0 deletions processing/casa/casa.pde
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
//Jane Hamel - Draw a House
size(800,800);
rect(50,200,500,350); // outside border of house
triangle(50,200,300,50,550,200); // roof
rect(85,250,100,225); // outside of left window
rect(415,250,100,225); // outside of right window
line(85,363,185,363); // horizontal line in left window
line(135,250,135,475); // vertical line in left window
line(415,363,515,363); // horizontal line in right window
line(465,250,465,475); // vertical line of right window
rect(250,250,100,300); // border of door
ellipse(270,393,15,15); // door knob

0 comments on commit 4292975

Please sign in to comment.