« Advanced ASP.NET 2.0 Course At Interface Technical Training | Main | FireFox Margin Issue »

New Video: Code Warm Ups : Arrays

Recently at Interface we began doing a lot of video blogs.  These are short instructional movies to help with particular topics of interest.  I have done 2 so far.  This is a link to one in a series I'm calling "Code Warm Ups".  I use these exercises before starting a project to help 'get in the zone' and also to remind myself of certain syntax etc..  It has helped me out a lot.  I have found that coding is like playing guitar, until you get to a certain level it's great to 'woodshed' (the practice of musicians locking themselves in a wood shed for hours at a time to  practice) to keep the knowledge you have gained sharp and ready for use.  Well enjoy the video, of course there is a little humor thrown in here and there to spice it up. Click Here to view video.

Here is the final code when the code warm up is done:

Enjoy!

 

using System;

using System.Collections.Generic;

using System.Text;

namespace Deletethisdrill

{

class Program

{

static void Main(string[] args)

{

string[] names = new string[] { "Simon", "Jason", "Jennifer", "Dan", "Michael" };for (int i = 0; i < names.Length; i++)

{

Console.WriteLine(names[i]);

}

Console.WriteLine(Environment.NewLine);

 

string[] copyNames = new string[names.Length];

names.CopyTo(copyNames, 0);

for (int i = 0; i < copyNames.Length; i++)

{

Console.WriteLine(copyNames[i]);

}

Console.WriteLine(Environment.NewLine);

for (int i = copyNames.GetUpperBound(0); i >=copyNames.GetLowerBound(0); i--)

{

Console.WriteLine(copyNames[i]);

}

Console.WriteLine(Environment.NewLine);

Array.Reverse(copyNames);

foreach (string name in copyNames)

{

Console.WriteLine(name);

}

}

}

}

Posted on Wednesday, December 13, 2006 at 03:02PM by Registered CommenterSpike Xavier | Comments1 Comment

PrintView Printer Friendly Version

EmailEmail Article to Friend

Reader Comments (1)

I see I'm no longer last...excellent. :)

You are tooo funny. Great code warm up video blog.
December 15, 2006 | Registered CommenterJennifer Campion
Editor Permission Required
You must have editing permission for this entry in order to post comments.