ABC problem: Difference between revisions

→‎{{header|Logtalk}}: Simplified test code.
(→‎{{header|Logtalk}}: Simplified test code.)
Line 5,900:
word_list(WordList),
blocks(BlockSet)::spell_no_spell(WordList, S, U),
print(@'The following words can be spelled by this block set:'::S),
print(@'The following words cannot be spelled by this block set:'::U),.
display(S),
print(@'The following words cannot be spelled by this block set:'),
display(U).
 
% test configuration data
 
block_set([b(b,o), b(x,k), b(d,q), b(c,p), b(n,a),
b(g,t), b(r,e), b(t,g), b(q,d), b(f,s),
b(j,w), b(h,u), b(v,i), b(a,n), b(o,b),
b(e,r), b(f,s), b(l,y), b(p,c), b(z,m)]).
 
word_list(['', 'A', 'bark', 'bOOk', 'treAT', 'COmmon', 'sQuaD', 'CONFUSE']).
 
% local helper predicates
display([H|T]) :- print(@[H|T]).
display([]) :- print(@'{ Ø }\n').
 
:- end_object.
Line 5,944 ⟶ 5,938:
?- blocks_test::run.
% The following words can be spelled by this block set:
% - ''
% [,A,bark,treAT,sQuaD,CONFUSE]
% - 'A'
% - bark
% - treAT
% - sQuaD
% - 'CONFUSE'
% The following words cannot be spelled by this block set:
% [- bOOk,COmmon]
% - 'COmmon'
true.
 
17

edits