/* Phrase reversals (Rosetta Code) in Picat. From http://rosettacode.org/wiki/Phrase_reversals """ Given a string of space separated words containing the following phrase: "rosetta code phrase reversal" Reverse the string. Reverse each individual word in the string, maintaining original string order. Reverse the order of each word of the phrase, maintaining the order of characters in each word. Show your output here. """ This Picat model was created by Hakan Kjellerstrand, hakank@gmail.com See also my Picat page: http://www.hakank.org/picat/ */ import util. main => go. go => S = "rosetta code phrase reversal", println(S), println(reverse(S)), println([reverse(W) : W in S.split()].join(' ')), println(reverse(S.split()).join(' ')), nl.