Click here to Skip to main content
12,396,606 members (32,447 online)
Click here to Skip to main content

Stats

34.1K views
366 downloads
14 bookmarked
Posted

KenKen Solver in WPF

, 7 Dec 2008 CPOL
My first WPF application to demonstrate solving KenKen puzzles.
<Window x:Class="KenKen.Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="KenKenSolver" Height="600" Width="579">
    <StackPanel>
        <Menu Height="22" Name="menu2" VerticalAlignment="Top">
            <MenuItem Header="Test" Click="Test_Click" VerticalAlignment="Top" />
            <MenuItem Header="Clear" Click="Clear_Click" VerticalAlignment="Top" />
        </Menu>
        <StackPanel Orientation="Horizontal">
            <Grid ShowGridLines="False" HorizontalAlignment="Left" VerticalAlignment="Top" Name="BoardGrid">
                <Grid.RowDefinitions>
                    <RowDefinition Name="r1" />
                    <RowDefinition Name="r2" />
                    <RowDefinition Name="r3" />
                    <RowDefinition Name="r4" />
                    <RowDefinition Name="r5" />
                    <RowDefinition Name="r6" />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Name="c1" Width="30" />
                    <ColumnDefinition Name="c2" Width="30" />
                    <ColumnDefinition Name="c3" Width="30" />
                    <ColumnDefinition Name="c4" Width="30" />
                    <ColumnDefinition Name="c5" Width="30" />
                    <ColumnDefinition Name="c6" Width="30" />
                </Grid.ColumnDefinitions>
            </Grid>
            <my:DataGrid Grid.Column="1" Name="RulesGrid" xmlns:my="clr-namespace:Microsoft.Windows.Controls;assembly=WPFToolkit" CanUserDeleteRows="True" CanUserResizeRows="False" 
                         Margin="40,0,0,0" HorizontalAlignment="Right" CanUserAddRows="True">
                <my:DataGrid.Columns>
                </my:DataGrid.Columns>
            </my:DataGrid>
        </StackPanel>
        <Button Height="23" Name="calculate" VerticalAlignment="Center" HorizontalAlignment="Stretch" Click="calculate_Click" Margin="20">Calculate</Button>
        <Label Grid.Row="1" HorizontalAlignment="Left" Name="label1" Width="120">Solution:</Label>
        <Label Grid.Row="2" Name="output" >...</Label>
    </StackPanel>
</Window>

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 Code Project Open License (CPOL)

Share

About the Author

tspitz
United Kingdom United Kingdom
No Biography provided

You may also be interested in...

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.160721.1 | Last Updated 7 Dec 2008
Article Copyright 2008 by tspitz
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid