Click here to Skip to main content
15,891,763 members
Articles / Desktop Programming / Windows Forms

Game of Life Simulator as Learning Tool

Rate me:
Please Sign up or sign in to vote.
4.89/5 (10 votes)
10 Sep 2009CDDL8 min read 44.3K   1.9K   39  
How I learned more about C#, UserControl, and project design by implementing a Game of Life simulator.
  • life.zip
    • Life
      • _Patterns
        • ACORN.LIF
        • ADDER.LIF
        • AK47.LIF
        • AQUA20.LIF
        • AQUA25.LIF
        • AQUA25B.LIF
        • AQUA33.LIF
        • AQUA33W.LIF
        • AQUA40.LIF
        • AQUA50.LIF
        • AQUA50F.LIF
        • AQUA50FA.LIF
        • AQUA50FN.LIF
        • AQUA50S.LIF
        • AQUA50SB.LIF
        • AQUA50SH.LIF
        • BARGE.LIF
        • BARGE2.LIF
        • BHEPTO.LIF
        • BHEPTPUF.LIF
        • BI-GUN.LIF
        • BLKRAKE.LIF
        • BREEDER.LIF
        • BREEDER2.LIF
        • BREEDER3.LIF
        • BREEDER4.LIF
        • BREEDER5.LIF
        • BREEDST.LIF
        • BSHIP.LIF
        • BSHIP2.LIF
        • BTRACK.LIF
        • C3PUF.LIF
        • COERAKE1.LIF
        • COERAKE2.LIF
        • CORDER.LIF
        • CORDER2.LIF
        • CORDPULL.LIF
        • CORDTOSS.LIF
        • CRYSTAL.LIF
        • CYCLTRON.LIF
        • DOUBLEX.LIF
        • E15GROW.LIF
        • EATERS.LIF
        • EDEN.LIF
        • EFENCE.LIF
        • FUSES.LIF
        • GLIDERS6.LIF
        • GLOSSARY.DOC
        • GUN104.LIF
        • GUN132.LIF
        • GUN144.LIF
        • GUN184.LIF
        • GUN246.LIF
        • GUN30.LIF
        • GUN44.LIF
        • GUN46.LIF
        • GUN4B.LIF
        • GUNB112.LIF
        • GUNB256.LIF
        • GUNB856.LIF
        • GUNSTAR.LIF
        • GUNSTAR2.LIF
        • GUNSTAR3.LIF
        • HACKSAW.LIF
        • HOTEL.LIF
        • HWSSGUN.LIF
        • IRRAT2.LIF
        • IRRAT5.LIF
        • IRRATU.LIF
        • JAWS.LIF
        • LINEPUF.LIF
        • LINEPUF2.LIF
        • LOGGROW.LIF
        • LOGGROW2.LIF
        • LONEDOTS.LIF
        • LOOP.LIF
        • LWSSGUN.LIF
        • LWSSRAK2.LIF
        • LWSSRAKE.LIF
        • MAKEBILS.LIF
        • MAKEFISH.LIF
        • MAKEFUSE.LIF
        • MAKEGUN.LIF
        • MAKEHSLR.LIF
        • MAKEOSCS.LIF
        • MAKEPOLE.LIF
        • MAX.LIF
        • MAX2.LIF
        • MAX3.LIF
        • MEMORY.LIF
        • MIRAGE.LIF
        • MWSSGUN.LIF
        • MWSSRAK2.LIF
        • MWSSRAKE.LIF
        • OSCSP2.LIF
        • OSCSP3.LIF
        • OSCSP3X.LIF
        • OSCSP4.LIF
        • OSCSP4X.LIF
        • OSCSP5.LIF
        • OSCSP6.LIF
        • OSCSP6X.LIF
        • OSCSP7-9.LIF
        • OSCSPN1.LIF
        • OSCSPN2.LIF
        • OSCSPN3.LIF
        • P136.LIF
        • P94S.LIF
        • PI.LIF
        • PINBALL.LIF
        • PIPUF.LIF
        • POLES.LIF
        • PRIMES.LIF
        • PSRTRAIN.LIF
        • PUFTRAIN.LIF
        • PULLER.LIF
        • PUSHER.LIF
        • PUSHGUN.LIF
        • PUSHGUN2.LIF
        • QUILT.LIF
        • RABBITS.LIF
        • RACE.LIF
        • RAKE.LIF
        • RAKE2.LIF
        • RAKE3.LIF
        • RAKEGUN.LIF
        • RANDGUN.LIF
        • RANDGUN2.LIF
        • RANDLWSS.LIF
        • README.DOC
        • RELAY.LIF
        • RELAY2.LIF
        • REVFUSE.LIF
        • ROT8.LIF
        • ROUND2.LIF
        • RPENTO.LIF
        • SAWTOOT2.LIF
        • SAWTOOT3.LIF
        • SAWTOOT4.LIF
        • SAWTOOT5.LIF
        • SAWTOOT6.LIF
        • SAWTOOT7.LIF
        • SAWTOOTH.LIF
        • SBMEM.LIF
        • SLOPUF.LIF
        • SLOPUF2.LIF
        • SLR.LIF
        • SPARK2PI.LIF
        • SPDRRAKE.LIF
        • SPIRAL.LIF
        • STARGATE.LIF
        • STATS.DOC
        • STILL.LIF
        • STRETCH.LIF
        • SWITCHEN.LIF
        • SWITCPUF.LIF
        • THICKGU2.LIF
        • THICKGUN.LIF
        • THINGUN.LIF
        • THINGUN2.LIF
        • THINGUN3.LIF
        • THINGUN4.LIF
        • THINRAKE.LIF
        • THUE.LIF
        • TIRETRAK.LIF
        • TIRETRAX.LIF
        • TNDRBIRD.LIF
        • TRACK.LIF
        • TUBTRAX.LIF
        • TWINDOTS.LIF
        • UNITCELL.LIF
        • VENETIA2.LIF
        • VENETIA3.LIF
        • VENETIAN.LIF
        • WING.LIF
        • WRITERS.DOC
        • ZIP2.LIF
        • ZIPS.LIF
      • DataLayer
      • Game of Life.sln
      • Game of Life.suo
      • Presentation
  • lifegame.zip
    • _Patterns
      • ACORN.LIF
      • ADDER.LIF
      • AK47.LIF
      • AQUA20.LIF
      • AQUA25.LIF
      • AQUA25B.LIF
      • AQUA33.LIF
      • AQUA33W.LIF
      • AQUA40.LIF
      • AQUA50.LIF
      • AQUA50F.LIF
      • AQUA50FA.LIF
      • AQUA50FN.LIF
      • AQUA50S.LIF
      • AQUA50SB.LIF
      • AQUA50SH.LIF
      • BARGE.LIF
      • BARGE2.LIF
      • BHEPTO.LIF
      • BHEPTPUF.LIF
      • BI-GUN.LIF
      • BLKRAKE.LIF
      • BREEDER.LIF
      • BREEDER2.LIF
      • BREEDER3.LIF
      • BREEDER4.LIF
      • BREEDER5.LIF
      • BREEDST.LIF
      • BSHIP.LIF
      • BSHIP2.LIF
      • BTRACK.LIF
      • C3PUF.LIF
      • COERAKE1.LIF
      • COERAKE2.LIF
      • CORDER.LIF
      • CORDER2.LIF
      • CORDPULL.LIF
      • CORDTOSS.LIF
      • CRYSTAL.LIF
      • CYCLTRON.LIF
      • DOUBLEX.LIF
      • E15GROW.LIF
      • EATERS.LIF
      • EDEN.LIF
      • EFENCE.LIF
      • FUSES.LIF
      • GLIDERS6.LIF
      • GLOSSARY.DOC
      • GUN104.LIF
      • GUN132.LIF
      • GUN144.LIF
      • GUN184.LIF
      • GUN246.LIF
      • GUN30.LIF
      • GUN44.LIF
      • GUN46.LIF
      • GUN4B.LIF
      • GUNB112.LIF
      • GUNB256.LIF
      • GUNB856.LIF
      • GUNSTAR.LIF
      • GUNSTAR2.LIF
      • GUNSTAR3.LIF
      • HACKSAW.LIF
      • HOTEL.LIF
      • HWSSGUN.LIF
      • IRRAT2.LIF
      • IRRAT5.LIF
      • IRRATU.LIF
      • JAWS.LIF
      • LINEPUF.LIF
      • LINEPUF2.LIF
      • LOGGROW.LIF
      • LOGGROW2.LIF
      • LONEDOTS.LIF
      • LOOP.LIF
      • LWSSGUN.LIF
      • LWSSRAK2.LIF
      • LWSSRAKE.LIF
      • MAKEBILS.LIF
      • MAKEFISH.LIF
      • MAKEFUSE.LIF
      • MAKEGUN.LIF
      • MAKEHSLR.LIF
      • MAKEOSCS.LIF
      • MAKEPOLE.LIF
      • MAX.LIF
      • MAX2.LIF
      • MAX3.LIF
      • MEMORY.LIF
      • MIRAGE.LIF
      • MWSSGUN.LIF
      • MWSSRAK2.LIF
      • MWSSRAKE.LIF
      • OSCSP2.LIF
      • OSCSP3.LIF
      • OSCSP3X.LIF
      • OSCSP4.LIF
      • OSCSP4X.LIF
      • OSCSP5.LIF
      • OSCSP6.LIF
      • OSCSP6X.LIF
      • OSCSP7-9.LIF
      • OSCSPN1.LIF
      • OSCSPN2.LIF
      • OSCSPN3.LIF
      • P136.LIF
      • P94S.LIF
      • PI.LIF
      • PINBALL.LIF
      • PIPUF.LIF
      • POLES.LIF
      • PRIMES.LIF
      • PSRTRAIN.LIF
      • PUFTRAIN.LIF
      • PULLER.LIF
      • PUSHER.LIF
      • PUSHGUN.LIF
      • PUSHGUN2.LIF
      • QUILT.LIF
      • RABBITS.LIF
      • RACE.LIF
      • RAKE.LIF
      • RAKE2.LIF
      • RAKE3.LIF
      • RAKEGUN.LIF
      • RANDGUN.LIF
      • RANDGUN2.LIF
      • RANDLWSS.LIF
      • README.DOC
      • RELAY.LIF
      • RELAY2.LIF
      • REVFUSE.LIF
      • ROT8.LIF
      • ROUND2.LIF
      • RPENTO.LIF
      • SAWTOOT2.LIF
      • SAWTOOT3.LIF
      • SAWTOOT4.LIF
      • SAWTOOT5.LIF
      • SAWTOOT6.LIF
      • SAWTOOT7.LIF
      • SAWTOOTH.LIF
      • SBMEM.LIF
      • SLOPUF.LIF
      • SLOPUF2.LIF
      • SLR.LIF
      • SPARK2PI.LIF
      • SPDRRAKE.LIF
      • SPIRAL.LIF
      • STARGATE.LIF
      • STATS.DOC
      • STILL.LIF
      • STRETCH.LIF
      • SWITCHEN.LIF
      • SWITCPUF.LIF
      • THICKGU2.LIF
      • THICKGUN.LIF
      • THINGUN.LIF
      • THINGUN2.LIF
      • THINGUN3.LIF
      • THINGUN4.LIF
      • THINRAKE.LIF
      • THUE.LIF
      • TIRETRAK.LIF
      • TIRETRAX.LIF
      • TNDRBIRD.LIF
      • TRACK.LIF
      • TUBTRAX.LIF
      • TWINDOTS.LIF
      • UNITCELL.LIF
      • VENETIA2.LIF
      • VENETIA3.LIF
      • VENETIAN.LIF
      • WING.LIF
      • WRITERS.DOC
      • ZIP2.LIF
      • ZIPS.LIF
    • Game of Life.exe
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProductVersion>9.0.30729</ProductVersion>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectGuid>{4461661F-FC4E-4215-8C14-8C2745BE63DF}</ProjectGuid>
    <OutputType>WinExe</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>kiswa.Games.Life.WinFormsApp</RootNamespace>
    <AssemblyName>Game of Life</AssemblyName>
    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
    <FileAlignment>512</FileAlignment>
    <ApplicationIcon>Life64x64.ico</ApplicationIcon>
    <ManifestCertificateThumbprint>458E07F5382F60402F913485D2C04AFE23131F4E</ManifestCertificateThumbprint>
    <ManifestKeyFile>kiswa.Games.Life.Presentation.WinForms_TemporaryKey.pfx</ManifestKeyFile>
    <GenerateManifests>false</GenerateManifests>
    <SignManifests>false</SignManifests>
    <IsWebBootstrapper>false</IsWebBootstrapper>
    <TargetZone>LocalIntranet</TargetZone>
    <PublishUrl>publish\</PublishUrl>
    <Install>true</Install>
    <InstallFrom>Disk</InstallFrom>
    <UpdateEnabled>false</UpdateEnabled>
    <UpdateMode>Foreground</UpdateMode>
    <UpdateInterval>7</UpdateInterval>
    <UpdateIntervalUnits>Days</UpdateIntervalUnits>
    <UpdatePeriodically>false</UpdatePeriodically>
    <UpdateRequired>false</UpdateRequired>
    <MapFileExtensions>true</MapFileExtensions>
    <ApplicationRevision>0</ApplicationRevision>
    <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
    <UseApplicationTrust>false</UseApplicationTrust>
    <PublishWizardCompleted>true</PublishWizardCompleted>
    <BootstrapperEnabled>true</BootstrapperEnabled>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>bin\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
    <DocumentationFile>..\..\Life.WinForms.xml</DocumentationFile>
    <UseVSHostingProcess>false</UseVSHostingProcess>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
    <DocumentationFile>..\..\Life.WinForms.xml</DocumentationFile>
    <UseVSHostingProcess>false</UseVSHostingProcess>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="System" />
    <Reference Include="System.Core">
      <RequiredTargetFramework>3.5</RequiredTargetFramework>
    </Reference>
    <Reference Include="System.Xml.Linq">
      <RequiredTargetFramework>3.5</RequiredTargetFramework>
    </Reference>
    <Reference Include="System.Data.DataSetExtensions">
      <RequiredTargetFramework>3.5</RequiredTargetFramework>
    </Reference>
    <Reference Include="System.Data" />
    <Reference Include="System.Deployment" />
    <Reference Include="System.Drawing" />
    <Reference Include="System.Windows.Forms" />
    <Reference Include="System.Xml" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="FormAbout.cs">
      <SubType>Form</SubType>
    </Compile>
    <Compile Include="FormAbout.Designer.cs">
      <DependentUpon>FormAbout.cs</DependentUpon>
    </Compile>
    <Compile Include="FormLife.cs">
      <SubType>Form</SubType>
    </Compile>
    <Compile Include="FormLife.Designer.cs">
      <DependentUpon>FormLife.cs</DependentUpon>
    </Compile>
    <Compile Include="Program.cs" />
    <Compile Include="Properties\AssemblyInfo.cs" />
    <EmbeddedResource Include="FormAbout.resx">
      <DependentUpon>FormAbout.cs</DependentUpon>
    </EmbeddedResource>
    <EmbeddedResource Include="FormLife.resx">
      <DependentUpon>FormLife.cs</DependentUpon>
    </EmbeddedResource>
    <EmbeddedResource Include="Properties\Resources.resx">
      <Generator>ResXFileCodeGenerator</Generator>
      <LastGenOutput>Resources.Designer.cs</LastGenOutput>
      <SubType>Designer</SubType>
    </EmbeddedResource>
    <Compile Include="Properties\Resources.Designer.cs">
      <AutoGen>True</AutoGen>
      <DependentUpon>Resources.resx</DependentUpon>
      <DesignTime>True</DesignTime>
    </Compile>
    <None Include="Properties\Settings.settings">
      <Generator>SettingsSingleFileGenerator</Generator>
      <LastGenOutput>Settings.Designer.cs</LastGenOutput>
    </None>
    <Compile Include="Properties\Settings.Designer.cs">
      <AutoGen>True</AutoGen>
      <DependentUpon>Settings.settings</DependentUpon>
      <DesignTimeSharedInput>True</DesignTimeSharedInput>
    </Compile>
  </ItemGroup>
  <ItemGroup>
    <ProjectReference Include="..\..\DataLayer\Life.DataLayer.csproj">
      <Project>{C8A6FBCC-521E-4AE0-877F-B0E159309434}</Project>
      <Name>Life.DataLayer</Name>
    </ProjectReference>
    <ProjectReference Include="..\Controls\Life.Presentation.CustomControls.csproj">
      <Project>{8131404E-7E7C-4EF5-82E7-490330C31360}</Project>
      <Name>Life.Presentation.CustomControls</Name>
    </ProjectReference>
  </ItemGroup>
  <ItemGroup>
    <PublishFile Include="GoL.ico">
      <Visible>False</Visible>
      <Group>
      </Group>
      <TargetPath>
      </TargetPath>
      <PublishState>Exclude</PublishState>
      <IncludeHash>True</IncludeHash>
      <FileType>File</FileType>
    </PublishFile>
  </ItemGroup>
  <ItemGroup>
    <BootstrapperPackage Include="Microsoft.Net.Client.3.5">
      <Visible>False</Visible>
      <ProductName>.NET Framework Client Profile</ProductName>
      <Install>false</Install>
    </BootstrapperPackage>
    <BootstrapperPackage Include="Microsoft.Net.Framework.2.0">
      <Visible>False</Visible>
      <ProductName>.NET Framework 2.0 %28x86%29</ProductName>
      <Install>false</Install>
    </BootstrapperPackage>
    <BootstrapperPackage Include="Microsoft.Net.Framework.3.0">
      <Visible>False</Visible>
      <ProductName>.NET Framework 3.0 %28x86%29</ProductName>
      <Install>false</Install>
    </BootstrapperPackage>
    <BootstrapperPackage Include="Microsoft.Net.Framework.3.5">
      <Visible>False</Visible>
      <ProductName>.NET Framework 3.5</ProductName>
      <Install>false</Install>
    </BootstrapperPackage>
    <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
      <Visible>False</Visible>
      <ProductName>.NET Framework 3.5 SP1</ProductName>
      <Install>true</Install>
    </BootstrapperPackage>
    <BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
      <Visible>False</Visible>
      <ProductName>Windows Installer 3.1</ProductName>
      <Install>true</Install>
    </BootstrapperPackage>
  </ItemGroup>
  <ItemGroup>
    <Content Include="Life64x64.ico" />
  </ItemGroup>
  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
       Other similar extension points exist, see Microsoft.Common.targets.
  <Target Name="BeforeBuild">
  </Target>
  <Target Name="AfterBuild">
  </Target>
  -->
  <PropertyGroup>
    <PostBuildEvent>if $(ConfigurationName)==Debug goto End
"$(ProjectDir)BuildTools\ilmerge.exe" /t:winexe /out:"$(TargetDir)Merged.exe" "$(TargetPath)" "$(TargetDir)Life.CustomControls.dll" "$(TargetDir)Life.DataLayer.dll"
cd "$(TargetDir)"
del Life.DataLayer.dll
del Life.CustomControls.dll
del *.pdb
del "$(TargetFileName)"
rename Merged.exe "$(TargetFileName)"
:End</PostBuildEvent>
    <PreBuildEvent>
    </PreBuildEvent>
  </PropertyGroup>
</Project>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Common Development and Distribution License (CDDL)


Written By
Software Developer (Senior)
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions