Code Race Documentation

Code race is very simple to setup. If you click the YouTube button in Visual Studio you can watch 'Code Race The Movie', or you can watch it here:

https://www.youtube.com/watch?v=162zmBPerzs

The first step is to copy the Code Race item template to the Visual Studio Item Template folder.

This may vary slightly based upon your version of Windows and / or Version of Visual Studio, but here is my path:

C:\Users\Corby\Documents\Visual Studio 2017\Templates\ItemTemplates\Visual C#

Once you have the item template in place, restart Visual Studio and the Code Race template will be available.

Template Methods

Init - The Init method is called by the constructor and this is where you should place any initialization code so your race is ready to run when the Start button is clicked.

RunRace1 - This is where you place the code for Method #1; this will be the red car on the top of the RaceTrackControl.

RunRace2 - This is where you place the code for Method #2; this will be the white car on the bottom of the RaceTrackControl..

Start - The start button notifies the RaceBaseObject to start the race, which sets the Race start time.

Controls

There are two user controls included with Code Race:

1. Race Info Control - this control is used to display the Name, the current value for Count, the Time Per Run in milliseconds and the Elapsed Time since the race began.

2. Race Track Control - This is the main control of the application as just about all the functionality is contained in this control.

Sample Object

Person

As shown in the video, a very simple person object is included with the download as I needed some type of object to demonstrate the For Each versus For Int race.

In addition to Code Race there are 4 other projects in the solution:

1. UltimateHelper - this project contains a collection of helper classes. This is another open source project, although the version included with this project is actually more up to date than the Ultimate Helper project on Code Plex. I will update the Code Plex project soon.

2. RandomShuffler - This project is used in the Vars Versus Non-Vars video. This project is also used by Random Banner as it shuffles which banner to show. This project is part of Card Counter, an open source black jack game I have been working on to make it simple to learn to count cards.

3. DataJuggler.Win.Controls - This is a collection of Windows Forms User Controls that speed of development time because most of the controls contain a Label and a Control. An example of this control is the LabelTextBoxControl and the LabelComboBox control.

4. Random Banner - This control shuffles the banners and shows them at 30 second intervals.

The Random Banner shows a couple of my open source projects; Xml Mirror 2.0 and DB Compare 2.0.

In addition, there are two more banners:

1. Teethathon - I setup a Go Fund Me page as I am trying to raise enough money to get implants as after 20 years of working for software companies that thought they were cool giving me free cokes has destroyed my teeth. If you can spare a few dollars or more I will cast a spell of good fortune upon you for the rest of your days; results may vary.

A special thanks to this month's sponsor: The Libertarian Dictator Audio Book.

http://www.audible.com/search?advsearchKeywords=the+libertarian+dictator&sprefixRefmarker=The+Libertar&sprefix=The+Libertar&sprefixRefmarker=The+Libertar&sprefixRefmarker=nb_sb_ss_i_2_12

If you have never downloaded an Audio book from Audible.com, your first book is free. The protagonist in this story and his partner are both programmers, so most of you will probably enjoy it.

--

If you create any interesting races, share the results and if you want the code for the race and send them to me at corby@datajuggler.com. I will do my best to answer all emails, but I can't make any promises.

If you have any questions or problems, leave a message on the Issues or the Discussions tab of this project.











Last edited Jan 24 at 6:28 AM by Corby, version 1