# Need help finding a pithy corouting example

**URL:** <https://rubytalk.org/t/need-help-finding-a-pithy-corouting-example/50095>\
**Category:** ruby-talk\
**Created:** [9 November 2008 15:19 UTC](https://rubytalk.org/t/need-help-finding-a-pithy-corouting-example/50095 "2008-11-09T15:19:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dave\_Mail\_Archive](https://avatars.discourse-cdn.com/v4/letter/d/f04885/32.png) [@Dave\_Mail\_Archive](https://rubytalk.org/u/Dave_Mail_Archive)\
**Post date:** [9 November 2008 15:19 UTC](https://rubytalk.org/t/need-help-finding-a-pithy-corouting-example/50095/1 "2008-11-09T15:19:40Z")

</div>

I'm looking for a concise but interesting example of corotuines to illustrate symmetrical fibers for the 1.9 edition of the PickAxe.

Way back in the dim past, I remember a logic puzzle to do with laying down a path of colored tiles such that there were no repeating subsequences. I remember coding a solution using coroutines in Simula. But I can't now find a formulation of the problem. Does anyone know it? Or can anyone suggest an alternative illustration of coroutines that will fit in about 20-30 lines.?

Thanks

Dave

---

<div class="post-metadata">

**Author:** ![bullockbefriending\_b](https://avatars.discourse-cdn.com/v4/letter/b/a698b9/32.png) [@bullockbefriending\_b](https://rubytalk.org/u/bullockbefriending_b)\
**Post date:** [9 November 2008 16:27 UTC](https://rubytalk.org/t/need-help-finding-a-pithy-corouting-example/50095/2 "2008-11-09T16:27:46Z")

</div>

Chapter 9 - Coroutines in Programming in Lua has a few examples.

Chapter 13.4 in Teach Yourself Scheme in Fixnum days has a tree-  
matching example.

Both are available in online versions.

> **···**
>
> On Nov 9, 10:19 pm, Dave Thomas \<d...@pragprog.com\> wrote:
> 
> > I'm looking for a concise but interesting example of corotuines to  
> > illustrate symmetrical fibers for the 1.9 edition of the PickAxe.
> > 
> > Way back in the dim past, I remember a logic puzzle to do with laying  
> > down a path of colored tiles such that there were no repeating  
> > subsequences. I remember coding a solution using coroutines in Simula.  
> > But I can't now find a formulation of the problem. Does anyone know  
> > it? Or can anyone suggest an alternative illustration of coroutines  
> > that will fit in about 20-30 lines.?
> > 
> > Thanks
> > 
> > Dave

---

<div class="post-metadata">

**Author:** ![Dave\_Mail\_Archive](https://avatars.discourse-cdn.com/v4/letter/d/f04885/32.png) [@Dave\_Mail\_Archive](https://rubytalk.org/u/Dave_Mail_Archive)\
**Post date:** [9 November 2008 16:46 UTC](https://rubytalk.org/t/need-help-finding-a-pithy-corouting-example/50095/3 "2008-11-09T16:46:46Z")

</div>

I should have said: I saw those, but I was looking for something a little more fun 🙂

> **···**
>
> On Nov 9, 2008, at 10:27 AM, bullockbefriending bard wrote:
> 
> > Chapter 9 - Coroutines in Programming in Lua has a few examples.
> > 
> > Chapter 13.4 in Teach Yourself Scheme in Fixnum days has a tree-  
> > matching example.
> > 
> > Both are available in online versions.
