Hacker News new | ask | show | jobs
by acc54321 3943 days ago
or in J

    graycodes=: verb define
        >(0&,&.>,1&,&.>@:|.)^:(<:y) 0 1
    )
    ' +'{~|:graycodes 6

                                ++++++++++++++++++++++++++++++++
                ++++++++++++++++++++++++++++++++                
        ++++++++++++++++                ++++++++++++++++        
    ++++++++        ++++++++        ++++++++        ++++++++    
  ++++    ++++    ++++    ++++    ++++    ++++    ++++    ++++  
 ++  ++  ++  ++  ++  ++  ++  ++  ++  ++  ++  ++  ++  ++  ++  ++