fork download
  1. : s, ( au-) dup c, here swap dup allot move ;
  2. : s+ ( a-a) count + ;
  3.  
  4. \ verses: tag c, beast s, aside s, len c,
  5. : v: ( u-) here >r c, parse-name s, 10 parse s, here r> - c, ;
  6. : v+ ( a-a) 1+ s+ s+ 1+ ;
  7. : v- ( a-a) 1- dup c@ - ;
  8. : tag ( au-af) over c@ = ;
  9.  
  10. Create fly
  11. 1 v: fly I don't know why she swallowed a fly, perhaps she'll die.
  12. 1 v: spider It wiggled and jiggled and tickled inside her.
  13. 0 v: bird How absurd, to swallow a bird.
  14. 0 v: cat Imagine that! She swallowed a cat!
  15. 0 v: dog What a hog to swallow a dog.
  16. 0 v: goat She just opened her throat and swallowed that goat.
  17. 0 v: cow I don't know how she swallowed that cow.
  18. 2 v: horse.. She's dead, of course.
  19.  
  20. : twaolwsa ( -) ." There was an old lady who swallowed a " ;
  21. : sst ( -) ." She swallowed the " ;
  22. : tct ( -) ." to catch the " ;
  23. : dot ( -) '.' emit ;
  24. : beast ( a-a) dup 1+ count type ;
  25. : aside ( a-a) cr dup 1+ s+ count type ;
  26. : ?aside ( a-a) 1 tag if aside then ;
  27. : reason- ( a-a) cr sst beast tct v- beast dot ?aside ;
  28. : reasons ( a-a) dup begin reason- dup fly = until drop ;
  29. : lyric ( a-a) cr cr twaolwsa beast dot aside ;
  30. : verses ( a-a) begin lyric reasons v+ 2 tag until ;
  31. : song ( -) fly lyric v+ verses lyric drop ;
  32. song
  33.  
Success #stdin #stdout #stderr 0.01s 5312KB
stdin
Standard input is empty
stdout

There was an old lady who swallowed a fly.
I don't know why she swallowed a fly, perhaps she'll die.

There was an old lady who swallowed a spider.
It wiggled and jiggled and tickled inside her.
She swallowed the spider to catch the fly.
I don't know why she swallowed a fly, perhaps she'll die.

There was an old lady who swallowed a bird.
How absurd, to swallow a bird.
She swallowed the bird to catch the spider.
It wiggled and jiggled and tickled inside her.
She swallowed the spider to catch the fly.
I don't know why she swallowed a fly, perhaps she'll die.

There was an old lady who swallowed a cat.
Imagine that! She swallowed a cat!
She swallowed the cat to catch the bird.
She swallowed the bird to catch the spider.
It wiggled and jiggled and tickled inside her.
She swallowed the spider to catch the fly.
I don't know why she swallowed a fly, perhaps she'll die.

There was an old lady who swallowed a dog.
What a hog to swallow a dog.
She swallowed the dog to catch the cat.
She swallowed the cat to catch the bird.
She swallowed the bird to catch the spider.
It wiggled and jiggled and tickled inside her.
She swallowed the spider to catch the fly.
I don't know why she swallowed a fly, perhaps she'll die.

There was an old lady who swallowed a goat.
She just opened her throat and swallowed that goat.
She swallowed the goat to catch the dog.
She swallowed the dog to catch the cat.
She swallowed the cat to catch the bird.
She swallowed the bird to catch the spider.
It wiggled and jiggled and tickled inside her.
She swallowed the spider to catch the fly.
I don't know why she swallowed a fly, perhaps she'll die.

There was an old lady who swallowed a cow.
I don't know how she swallowed that cow.
She swallowed the cow to catch the goat.
She swallowed the goat to catch the dog.
She swallowed the dog to catch the cat.
She swallowed the cat to catch the bird.
She swallowed the bird to catch the spider.
It wiggled and jiggled and tickled inside her.
She swallowed the spider to catch the fly.
I don't know why she swallowed a fly, perhaps she'll die.

There was an old lady who swallowed a horse...
She's dead, of course.
stderr
redefined S, with s,  redefined s+