Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
13
Task/Floyds-triangle/Prolog/floyds-triangle.pro
Normal file
13
Task/Floyds-triangle/Prolog/floyds-triangle.pro
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
floyd(N) :-
|
||||
forall(between(1, N, I),
|
||||
( forall(between(1,I, J),
|
||||
( Last is N * (N-1)/2+J,
|
||||
V is I * (I-1) /2 + J,
|
||||
get_column(Last, C),
|
||||
sformat(AR, '~~t~~w~~~w| ', [C]),
|
||||
sformat(AF, AR, [V]),
|
||||
writef(AF))),
|
||||
nl)).
|
||||
|
||||
get_column(Last, C) :-
|
||||
name(Last, N1), length(N1,C).
|
||||
Loading…
Add table
Add a link
Reference in a new issue