Jay McGavren's Journal

2010-03-07

Another Ruby tweet...

Was browsing the new Popular Science archives, which led to an article from 1984, which had a picture of the book Creative Graphics for the BBC Microcomputer, which led me to an archived copy of the book online, which had a dirt-simple program to draw Lissajous curves, which led me to write this tweetable Ruby version. (Phew!)

ruby -rcurses -e"include Curses;i=0;loop{setpos 12*(Math.sin(i)+1),40*(Math.cos(i*0.2)+1);addstr'.';i+=0.01;refresh}" #ruby
****         *******                ********                ******           **
*  *        **     **              **      **              **     *         * **
*  **       *       **            **        **            **       *        *  *
*   *      *         **          *           **          **        **      *   *
*   *      *          *         **             *         *          **     *   *
*    *    *            *        *              **       *            *    *    *
*    *   **             *      *                **     **            **   *    *
*    **  *              **    *                  *     *              *   *    *
*     * **               *   **                  **   *               ** *     *
*     * *                ** **                    *  *                 * *     *
*     * *                 * *                      * *                 **      *
*      **                  **                      **                   *      *
*      *                   **                       *                   *      *
*      **                 * *                      * *                 ***     *
*     * *                **  *                    *   *                * *     *
*     *  *               *   **                  **   *               ** *     *
*    *   *              *     *                  *     *              *  **    *
*    *   **            *       *                *      *             *    *    *
*   **    *            *       *               *        *            *    *    *
*   *     **          **        **            **         *          *      *   *
*   *      *         *           **           *          **         *      *   *
*  *        *       **            **        **            **       *       **  *
** *         *     **              **      **              **     **        * **
 **           ******                 *******                *******         ***
comments powered by Disqus