Jan 10 2012

The Ants Go Marching

Category: pseudocode commentarychick @ 18:00

public TheAntsGoMarching()
{
    // We'll pretend this index starts at 1.
    string[] antActions = new string[10] { 
        "suck his thumb",
        "tie his shoe",
        "climb a tree",
        "shut the door",
        "take a dive",
        "pick up sticks",
        "pray to heaven",
        "shut the gate",
        "check the time",
        "say 'THE END'"
    };

    for(int antIndex = 1; antIndex < 11; antIndex ++)
    {
        for(int marchingIndex = 0; marchingIndex < 2; marchingIndex++)
        {
            TheAntsGoMarching(antIndex + "by" + antIndex);
            Hurrah(2);
        }

        TheAntsGoMarching(antIndex + "by" + antIndex);

        TheLittleOneStopsTo(antActions[antIndex]);

        AndTheyAllGoMarching("down to the ground, to get out of the rain");

        for(int boomIndex = 0; boomIndex < 3; boomIndex++)
        {
            BOOM();
        }
    }
}

Tags:

Dec 13 2011

Whole Foods Description Generator

Category: pseudocode commentarychick @ 12:30

public List<string> Keywords = new List<string>();

Keywords.Add("grass-fed ");
Keywords.Add("free-range ");
Keywords.Add("organic ");
Keywords.Add("all-natural ");
Keywords.Add("hormone-free ");
Keywords.Add("locally-grown ");
Keywords.Add("hand-picked ");

public string GenerateDescription(string foodName, int descriptorCount)
{
    StringBuilder description = new StringBuilder();

    // Pick some randomly wholesome keywords
    while(descriptorCount > 0)
    {
        description.Append(Keywords[Random.Next(Keywords.Count -1)]);
        descriptorCount--;
    }

    description.Append(foodName);

    return description.ToString();
}

public void WholeFoodsDescriptionGenerator()
{
    GenerateDescription("beef", 2);
    // Output: grass-fed free-range beef

    GenerateDescription("honey", 2);
    // Output: locally-grown all-natural honey

    GenerateDescription("tortillas", 3);
    // Output: hormone-free organic free-range tortillas

    GenerateDescription("apples", 1);
    // Output: organic apple

    GenerateDescription("paper towels", 3);
    // Output: hormone-free all-natural free-range paper towels
}

Tags:

Dec 2 2011

Crossfit-Induced Mindshift

Category: pseudocode commentarychick @ 15:30

public CrossfitInducedMindshift()
{
    if(this.IsAtCrossfit)
    {
        Yay(this);
        LiftHeavyWeights();
        LayOnDirtyFloorWhileRecoveringFromMetcon();
        ShedSweatySaltyTears();
        Smile();
    }

    if(!this.IsAtCrossfit)
    {
        ComplainAboutCarryingBagsOfGroceries();
        AvoidSittingOnDirtyOutdoorBenches();
        ParkCloseToShopEntrances();
        Exist();
    }
}

Tags:

Dec 2 2011

Christmas Gift Selection

Category: pseudocode commentarychick @ 14:30

public Gift GetChristmasGift(Person person, double minimumPrice, double maximumPrice)
{
    Gift gift;

    try
    {
        if(minimumPrice > 0)
            gift = person.WishlistItems.Where(item => item.Price > minimumPrice && item.Price < maximumPrice).First();
        else
            gift = WineOrChocolate(person);
    }
    catch(NoWishlistException)
    {
        // Grrrr, no wishlist. :(
        gift = WineOrChocolate(person);
    }
    catch(NoItemsFoundInPriceRangeException)
    {
        // Try a lower price range
        gift = GetChristmasGift(person, (minimumPrice / 2) - 1, minimumPrice);
    }

    return gift;
}

public Gift WineOrChocolate(person) 
{
    return person.EnjoysWine ? new Gift("Bottle of wine") : new Gift("Fancy chocolates");
}

Tags:

Nov 8 2011

Development Team Video Conference Prep

Category: pseudocode commentarychick @ 16:30

public DevelopmentTeamVideoConferencePrep()
{
    WashFace(); // Please, no smudged mascara from yesterday.
    PutOnMakeup(); // But fresh mascara is ok.
    BrushHair(); // My excuse last time: "but my hair looks like a crow's nest!"
    GetDressed(); // Preferably in something other than pajamas or a bathrobe.

    Assert.IsTrue(ReadyToVideoConferenceWithCoWorkers());
}

Tags:

Nov 7 2011

Minimalist Living Options

Category: pseudocode commentarychick @ 07:00

public MinimalistLiving()
{
    Ideas.Add("Tiny house", "http://www.tumbleweedhouses.com/");
    Ideas.Add("RV", "http://www.sunshinestatervs.com/2004-chinook-concourse-used-class-b-fl-i336827");
    Ideas.Add("Small apartment", "http://freshome.com/2010/08/02/incredible-space-maximization-in-a-small-studio-apartment/");
    Ideas.Add("Empty room", "http://www.shutterstock.com/pic-26409287/stock-photo--d-illustration-of-a-large-bright-empty-room-with-windows-either-side.html");
}

Tags:

Oct 30 2011

The Crow and the Pitcher

Category: pseudocode commentary | aesopchick @ 23:39

public void TheCrowAndThePitcher()
{
	if(Crow.IsThirsty && !Pitcher.WaterIsAccessibleToCrow)
	{
		while(!Pitcher.WaterAccessible)
		{
			Pitcher.Add("Pebble");
		}

		// Little by little does the trick!
		QuenchThirst(Pitcher);
	}
}

Tags:

Oct 23 2011

Item Usefulness Test

Category: pseudocode commentarychick @ 14:30

public ItemUsefulnessTest(Item item)
{
    if(IsUseful(item) || IsBeautiful(item) || MakesMoney(item))
        Keep(item);
    else
        Dispose(item);
}

Tags:

Oct 16 2011

Life Is But A Dream

Category: pseudocode commentarychick @ 22:00

public LifeIsButADream()
{
    while(Life == "But a dream")
    {
        GentlyDownTheStream(RowRowRow("Your boat"));
        Merrily();
        Merrily();
        Merrily();
        Merrily();
    }
}

Tags:

Oct 9 2011

Gaming Convention Identifying Features

Category: pseudocode commentarychick @ 20:00

public GamingConventionIdentifyingFeatures()
{
    Features.Add("Count(Females) < Count(Males named John)");
    Features.Add("Count(Females not romantically attached to an attending male) < Count(Females) * .5");
    Features.Add("New facebook friends, post con += Count(Attendees) * .3");
    // I missed the dress code memo
    Features.Add("Count(Attendees wearing theme/game-specific t-shirts) > Count(Attendees) * .75");
    // Shiny.
    Features.Add("Count(Firefly fans) > Count(Attendees) * .7");
    Features.Add("Count(Cans of soda consumed) > Count(Attendees) * 4");
    // So friendly.
    Features.Add("Count(Hugs given upon departure) > Count(Attendees) * .7");
    // TOO MANY!
    Features.Add("Count(Days until next convention) > Unknown");
}

Tags: