Two challenges with struck-through text

@DeusIrae

The speed seems reasonable with a slightly efficient loop that isn’t transmuting/untransmuting the text twice per character.

lab is a room.
strikethrough is always unicode 822.
newline is always unicode 10.

when play begins:
repeat for c in chars of wotw  begin;
  say c;
  if c is not newline, say strikethrough;
end repeat;

To repeat with/for (c - nonexisting unicode character variable) running/-- through/in chars/characters of/in/for (t - text) begin -- end loop:
(-
  {-my:0} = {t}-->0;
  @push {-my:0};
  {-my:1} = TEXT_TY_Temporarily_Transmute({-by-reference:t});
  @push {-my:1};
  for ( {-my:1} = 0, {c} = BlkValueRead({-by-reference:t}, 0) : {c} : {c} = BlkValueRead({-by-reference:t}, ++{-my:1} ))
    {-block}
   @pull {-my:1};
   @pull {-my:0};
   TEXT_TY_Untransmute({-by-reference:t}, {-my:1}, {-my:0});
-)

wotw is initially "No one would have believed in the last years of the nineteenth century that this world
was being watched keenly and closely by intelligences greater than man's and yet as mortal as his
own; that as men busied themselves about their various concerns they were scrutinised and studied,
perhaps almost as narrowly as a man with a microscope might scrutinise the transient creatures that
swarm and multiply in a drop of water. With infinite complacency men went to and fro over this globe
about their little affairs, serene in their assurance of their empire over matter. It is possible
that the infusoria under the microscope do the same. No one gave a thought to the older worlds of
space as sources of human danger, or thought of them only to dismiss the idea of life upon them as
impossible or improbable. It is curious to recall some of the mental habits of those departed days.
At most terrestrial men fancied there might be other men upon Mars, perhaps inferior to themselves
and ready to welcome a missionary enterprise. Yet across the gulf of space, minds that are to our
minds as ours are to those of the beasts that perish, intellects vast and cool and unsympathetic,
regarded this earth with envious eyes, and slowly and surely drew their plans against us. And early
in the twentieth century came the great disillusionment.";

[ Edited to replace code with an improved version ]

3 Likes