how to do new line char

From: Drew (drew_at_drew.com)
Date: 03/02/05


Date: Tue, 01 Mar 2005 18:12:49 -0500


Hi All:

I have a predicate which has the below as one of its clauses. So, the
output of my Prolog program is for example:

X = [s(aberdeen, 682, [penzance, exeter, bristol, birmingham,
manchester, carlisle, edinburgh, aberdeen]), s(aberystwyth, 352,
[penzance, exeter, bristol, swansea, aberystwyth]), s(birmingham, 274,
[penzance, exeter, bristol, birmingham]), s(brighton, 287, [penzance,
exeter, portsmouth, brighton]), s(bristol, 188, [penzance, exeter,
bristol]), ......

I would like to make the program print a newline character after each
s (small s) set that is displayed to improve readability of the
output. Note that each s has 3 parts to it. A destination city,
mileage, and then a list with other cities.

Here is the clause. I want to print a newline after each small
s--s(Vertex, Distance, Path) that is displayed. Is it possible? I'm
using SWI-Prolog.

  S = s(Vertex, Distance, Path),

Thanks!
Drew



Relevant Pages

  • Re: BBC News: MP calls for high speed rail link
    ... Three and a half hours to Penzance ... > current berks & hants route to Exeter. ... Of course, the route past Exeter ... improve but the improvement in journey times for Plymouth and Exeter ...
    (uk.railway)
  • Re: Exeter - Penzance
    ... The above takes into account that it's a Sunday, and from Exeter to ... SWT runs one train from Exeter to Penzance using a 159 on a ... it's also possible to travel in hauled stock behind a 57 ... the train has left Penzance hauled by a pair of HST power cars back-to-back. ...
    (uk.railway)
  • Re: Try First Great Western for free
    ... I was getting excited for a moment; my wife and I were just wondering about a day out in Exeter. ... or a 1 Day Cornwall Ranger for £10 and go anywhere in Cornwall. ... So Exeter to Penzance return for £10 is not bad particularly as it is ...
    (uk.railway)
  • Re: Rogue train in the system, or overnight on XC
    ... 2203 to Penzance ... This train was on time at Exeter St Davids, according to the LDB. ...
    (uk.railway)