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.159 tracks/prolog/exercises/isogram/isogram.example
trackler-2.2.1.158 tracks/prolog/exercises/isogram/isogram.example
trackler-2.2.1.157 tracks/prolog/exercises/isogram/isogram.example
trackler-2.2.1.156 tracks/prolog/exercises/isogram/isogram.example
trackler-2.2.1.155 tracks/prolog/exercises/isogram/isogram.example
trackler-2.2.1.154 tracks/prolog/exercises/isogram/isogram.example
trackler-2.2.1.153 tracks/prolog/exercises/isogram/isogram.example
trackler-2.2.1.152 tracks/prolog/exercises/isogram/isogram.example
trackler-2.2.1.151 tracks/prolog/exercises/isogram/isogram.example
trackler-2.2.1.150 tracks/prolog/exercises/isogram/isogram.example
trackler-2.2.1.149 tracks/prolog/exercises/isogram/isogram.example
trackler-2.2.1.148 tracks/prolog/exercises/isogram/isogram.example
trackler-2.2.1.147 tracks/prolog/exercises/isogram/isogram.example
trackler-2.2.1.146 tracks/prolog/exercises/isogram/isogram.example
trackler-2.2.1.145 tracks/prolog/exercises/isogram/isogram.example
trackler-2.2.1.144 tracks/prolog/exercises/isogram/isogram.example
trackler-2.2.1.143 tracks/prolog/exercises/isogram/isogram.example
trackler-2.2.1.142 tracks/prolog/exercises/isogram/isogram.example
trackler-2.2.1.141 tracks/prolog/exercises/isogram/isogram.example
trackler-2.2.1.140 tracks/prolog/exercises/isogram/isogram.example