Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Fibonacci Butt Sort

Name: Anonymous 2009-08-16 23:08

Let us discuss the various implementations of theFIBONACCI BUTT SORT.

Name: Anonymous 2011-04-07 4:44

0> 2011-04-07 10:41:16 +02:00 :: ed@neetbook :: 16KB in 2 files :: ~/Projects/buttsort/buttsort/bin/Debug
 :: mono buttsort.exe
FIBONACCI BUTTSORT


FBIUBTOTNSAOCRCTI .


using System;

namespace buttsort
{
    class MainClass
    {
        const bool flipit = true;
       
        public static void Main (string[] args)
        {
            int i = 0;
            string msg = Console.ReadLine();
            string[,] arg = new string[,] {
                //{ "[o]", "[/o]" },
                //{ "[u]", "[/u]" }
                { "[sub][u][b]", "[/b][/u][/sub]" },
                { "[sup][o]",        "[/o][/sup]" }
            };
           
            if (flipit)
            {
                bool f = false;
                string spline = "";
                int o = msg.Length / 2;
                for (int a = 0; a < o; a++)
                {
                    f = !f; spline += msg[f?a:a+o];
                    f = !f; spline += msg[f?a:a+o];
                }
                msg = spline;
            }
           
            foreach (char c in msg)
            {
                i = Math.Abs(i-1);
                Console.Write( arg[i,0]
                         + c + arg[i,1] );
            }
        }
    }
}


my work here is done.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List