Comment detail

条件を満たす行を取り除く (Nested Flatten)

This comment is reply for 1159 katsu: とりあえず、ライブラリを使わずに。(条件を満たす行を取り除く). Go to thread root.

read_line_to_codeを使うと、ユーザー入力にした場合、入力を待ってくれないのをどうすればよいのか判らないのです。
1
2
3
4
5
6
lineLoop(Str):-
        read_line_to_codes(Str,Line),
        (Line=[35|_]->write("");
         (not(Line=end_of_file)->string_to_list(S,Line),writeln(S),lineLoop(Str); true)).

:- prompt(_,''),current_stream(_,'read',Str),lineLoop(Str), halt.

Index

Feed

Other

Link

Pathtraq

loading...