Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.forth > #20470

Word-Mungler

From "WJ" <w_a_x_man@yahoo.com>
Newsgroups comp.lang.forth
Subject Word-Mungler
Date 2013-03-08 20:21 +0000
Organization A noiseless patient Spider
Message-ID <khdh8s$268$1@dont-email.me> (permalink)

Show all headers | View raw


Shuffle the interior letters of each word.

USING: locals random regexp ;

:: mungle-word ( str -- str )
  str R/ [a-zA-Z]+/ matches?
  str length 3 >  and
  [ str rest-slice but-last-slice randomize drop ]
  when
  str
;

: mungle ( str -- str )
  R/ [a-zA-Z]+|[^a-zA-Z]+/ all-matching-subseqs
  [ mungle-word ]
  map
  "" join
;

"They are not interested in using or making a good language.
Their only desire is to worship the apes who wrote
the 'Forth standard'."
mungle print


They are not irtenteesd in unsig or mikang a good lguaange.
Thier only derise is to woshirp the aeps who wtroe
the 'Ftroh santdard'.

Back to comp.lang.forth | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Word-Mungler "WJ" <w_a_x_man@yahoo.com> - 2013-03-08 20:21 +0000
  Re: Word-Mungler "WJ" <w_a_x_man@yahoo.com> - 2013-03-08 23:39 +0000
    Re: Word-Mungler Zbiggy <zbigniew2011REMOVE@gmail.REMOVE.com> - 2013-03-08 23:53 +0000

csiph-web