Sha256: e1c1532a7f7acf43c657f3890b3f41dc87d3362b5f57e7d0a14ff2c06b632458

Contents?: true

Size: 383 Bytes

Versions: 68

Compression:

Stored size: 383 Bytes

Contents

% returns true if X is at most, 1 time in L.
atMost1(X, XS) :-
 findall(E, (member(E, XS), X = E), O), length(O, LO), LO =< 1.

% returns true if every letter of the engilsh alphabet is at most 1 time in S.
isogram(S) :-
  atom_codes("abcdefghijklmnopqrstuvwxyz", ABC),
  string_lower(S, LowerS),
  atom_codes(LowerS, NormalizedS),
  forall(member(L, ABC), atMost1(L, NormalizedS)).

Version data entries

68 entries across 68 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/prolog/exercises/isogram/isogram.example
trackler-2.2.1.179 tracks/prolog/exercises/isogram/isogram.example
trackler-2.2.1.178 tracks/prolog/exercises/isogram/isogram.example
trackler-2.2.1.177 tracks/prolog/exercises/isogram/isogram.example
trackler-2.2.1.176 tracks/prolog/exercises/isogram/isogram.example
trackler-2.2.1.175 tracks/prolog/exercises/isogram/isogram.example
trackler-2.2.1.174 tracks/prolog/exercises/isogram/isogram.example
trackler-2.2.1.173 tracks/prolog/exercises/isogram/isogram.example
trackler-2.2.1.172 tracks/prolog/exercises/isogram/isogram.example
trackler-2.2.1.171 tracks/prolog/exercises/isogram/isogram.example
trackler-2.2.1.170 tracks/prolog/exercises/isogram/isogram.example
trackler-2.2.1.169 tracks/prolog/exercises/isogram/isogram.example
trackler-2.2.1.167 tracks/prolog/exercises/isogram/isogram.example
trackler-2.2.1.166 tracks/prolog/exercises/isogram/isogram.example
trackler-2.2.1.165 tracks/prolog/exercises/isogram/isogram.example
trackler-2.2.1.164 tracks/prolog/exercises/isogram/isogram.example
trackler-2.2.1.163 tracks/prolog/exercises/isogram/isogram.example
trackler-2.2.1.162 tracks/prolog/exercises/isogram/isogram.example
trackler-2.2.1.161 tracks/prolog/exercises/isogram/isogram.example
trackler-2.2.1.160 tracks/prolog/exercises/isogram/isogram.example