Permalink
Browse files

1.0 for JAVA and C# :-)

  • Loading branch information...
mariuszgromada committed Apr 9, 2016
1 parent ca9af22 commit 0fd95adac3b914353106f4380c27301e7507b273
Showing with 11,923 additions and 310 deletions.
  1. +9 −3 .gitignore
  2. +67 −0 CURRENT/c-sharp/Janet-Sudoku.csproj
  3. +28 −0 CURRENT/c-sharp/Janet-Sudoku.sln
  4. +6 −0 CURRENT/c-sharp/Run-Tests/App.config
  5. +15 −0 CURRENT/c-sharp/Run-Tests/JanetSudokuRunTests.cs
  6. +36 −0 CURRENT/c-sharp/Run-Tests/Properties/AssemblyInfo.cs
  7. +66 −0 CURRENT/c-sharp/Run-Tests/Run-Tests.csproj
  8. +146 −0 CURRENT/c-sharp/src/org/mariuszgromada/math/janetsudoku/BoardCell.cs
  9. +336 −0 CURRENT/c-sharp/src/org/mariuszgromada/math/janetsudoku/ErrorCodes.cs
  10. +125 −0 CURRENT/c-sharp/src/org/mariuszgromada/math/janetsudoku/SudokuBoard.cs
  11. +756 −0 CURRENT/c-sharp/src/org/mariuszgromada/math/janetsudoku/SudokuGenerator.cs
  12. +3,092 −0 CURRENT/c-sharp/src/org/mariuszgromada/math/janetsudoku/SudokuPuzzles.cs
  13. +1,337 −0 CURRENT/c-sharp/src/org/mariuszgromada/math/janetsudoku/SudokuSolver.cs
  14. +1,706 −0 CURRENT/c-sharp/src/org/mariuszgromada/math/janetsudoku/SudokuStore.cs
  15. +134 −0 CURRENT/c-sharp/src/org/mariuszgromada/math/janetsudoku/regtests/RegTests.cs
  16. +501 −0 CURRENT/c-sharp/src/org/mariuszgromada/math/janetsudoku/regtests/RegTestsApi.cs
  17. +448 −0 CURRENT/c-sharp/src/org/mariuszgromada/math/janetsudoku/regtests/RegTestsGenerator.cs
  18. +481 −0 CURRENT/c-sharp/src/org/mariuszgromada/math/janetsudoku/regtests/RegTestsSolver.cs
  19. +1,759 −0 CURRENT/c-sharp/src/org/mariuszgromada/math/janetsudoku/regtests/RegTestsStore.cs
  20. +142 −0 CURRENT/c-sharp/src/org/mariuszgromada/math/janetsudoku/tutorial/Tutorial.cs
  21. +98 −0 CURRENT/c-sharp/src/org/mariuszgromada/math/janetsudoku/utils/ArrayX.cs
  22. +113 −0 CURRENT/c-sharp/src/org/mariuszgromada/math/janetsudoku/utils/DateTimeX.cs
  23. +181 −0 CURRENT/c-sharp/src/org/mariuszgromada/math/janetsudoku/utils/FileX.cs
  24. +2 −2 CURRENT/doc/allclasses-frame.html
  25. +2 −2 CURRENT/doc/allclasses-noframe.html
  26. +2 −2 CURRENT/doc/constant-values.html
  27. +2 −2 CURRENT/doc/deprecated-list.html
  28. +2 −2 CURRENT/doc/help-doc.html
  29. +2 −2 CURRENT/doc/index-files/index-1.html
  30. +2 −2 CURRENT/doc/index-files/index-10.html
  31. +2 −2 CURRENT/doc/index-files/index-11.html
  32. +6 −2 CURRENT/doc/index-files/index-12.html
  33. +2 −2 CURRENT/doc/index-files/index-13.html
  34. +2 −2 CURRENT/doc/index-files/index-14.html
  35. +2 −2 CURRENT/doc/index-files/index-15.html
  36. +2 −2 CURRENT/doc/index-files/index-16.html
  37. +8 −4 CURRENT/doc/index-files/index-17.html
  38. +2 −2 CURRENT/doc/index-files/index-2.html
  39. +2 −2 CURRENT/doc/index-files/index-3.html
  40. +2 −2 CURRENT/doc/index-files/index-4.html
  41. +2 −2 CURRENT/doc/index-files/index-5.html
  42. +2 −2 CURRENT/doc/index-files/index-6.html
  43. +6 −2 CURRENT/doc/index-files/index-7.html
  44. +2 −2 CURRENT/doc/index-files/index-8.html
  45. +2 −2 CURRENT/doc/index-files/index-9.html
  46. +1 −1 CURRENT/doc/index.html
  47. +3 −3 CURRENT/doc/org/mariuszgromada/math/janetsudoku/BoardCell.html
  48. +5 −5 CURRENT/doc/org/mariuszgromada/math/janetsudoku/ErrorCodes.html
  49. +3 −3 CURRENT/doc/org/mariuszgromada/math/janetsudoku/SudokuBoard.html
  50. +4 −7 CURRENT/doc/org/mariuszgromada/math/janetsudoku/SudokuGenerator.html
  51. +4 −4 CURRENT/doc/org/mariuszgromada/math/janetsudoku/SudokuPuzzles.html
  52. +5 −11 CURRENT/doc/org/mariuszgromada/math/janetsudoku/SudokuSolver.html
  53. +122 −67 CURRENT/doc/org/mariuszgromada/math/janetsudoku/SudokuStore.html
  54. +2 −2 CURRENT/doc/org/mariuszgromada/math/janetsudoku/class-use/BoardCell.html
  55. +2 −2 CURRENT/doc/org/mariuszgromada/math/janetsudoku/class-use/ErrorCodes.html
  56. +2 −2 CURRENT/doc/org/mariuszgromada/math/janetsudoku/class-use/SudokuBoard.html
  57. +2 −2 CURRENT/doc/org/mariuszgromada/math/janetsudoku/class-use/SudokuGenerator.html
  58. +2 −2 CURRENT/doc/org/mariuszgromada/math/janetsudoku/class-use/SudokuPuzzles.html
  59. +2 −2 CURRENT/doc/org/mariuszgromada/math/janetsudoku/class-use/SudokuSolver.html
  60. +2 −2 CURRENT/doc/org/mariuszgromada/math/janetsudoku/class-use/SudokuStore.html
  61. +2 −2 CURRENT/doc/org/mariuszgromada/math/janetsudoku/package-frame.html
  62. +2 −2 CURRENT/doc/org/mariuszgromada/math/janetsudoku/package-summary.html
  63. +2 −2 CURRENT/doc/org/mariuszgromada/math/janetsudoku/package-tree.html
  64. +2 −2 CURRENT/doc/org/mariuszgromada/math/janetsudoku/package-use.html
  65. +4 −4 CURRENT/doc/org/mariuszgromada/math/janetsudoku/regtests/RegTests.html
  66. +4 −4 CURRENT/doc/org/mariuszgromada/math/janetsudoku/regtests/RegTestsApi.html
  67. +3 −3 CURRENT/doc/org/mariuszgromada/math/janetsudoku/regtests/RegTestsGenerator.html
  68. +3 −3 CURRENT/doc/org/mariuszgromada/math/janetsudoku/regtests/RegTestsSolver.html
  69. +4 −4 CURRENT/doc/org/mariuszgromada/math/janetsudoku/regtests/RegTestsStore.html
  70. +2 −2 CURRENT/doc/org/mariuszgromada/math/janetsudoku/regtests/class-use/RegTests.html
  71. +2 −2 CURRENT/doc/org/mariuszgromada/math/janetsudoku/regtests/class-use/RegTestsApi.html
  72. +2 −2 CURRENT/doc/org/mariuszgromada/math/janetsudoku/regtests/class-use/RegTestsGenerator.html
  73. +2 −2 CURRENT/doc/org/mariuszgromada/math/janetsudoku/regtests/class-use/RegTestsSolver.html
  74. +2 −2 CURRENT/doc/org/mariuszgromada/math/janetsudoku/regtests/class-use/RegTestsStore.html
  75. +2 −2 CURRENT/doc/org/mariuszgromada/math/janetsudoku/regtests/package-frame.html
  76. +2 −2 CURRENT/doc/org/mariuszgromada/math/janetsudoku/regtests/package-summary.html
  77. +2 −2 CURRENT/doc/org/mariuszgromada/math/janetsudoku/regtests/package-tree.html
  78. +2 −2 CURRENT/doc/org/mariuszgromada/math/janetsudoku/regtests/package-use.html
  79. +3 −3 CURRENT/doc/org/mariuszgromada/math/janetsudoku/tutorial/Tutorial.html
  80. +2 −2 CURRENT/doc/org/mariuszgromada/math/janetsudoku/tutorial/class-use/Tutorial.html
  81. +2 −2 CURRENT/doc/org/mariuszgromada/math/janetsudoku/tutorial/package-frame.html
  82. +2 −2 CURRENT/doc/org/mariuszgromada/math/janetsudoku/tutorial/package-summary.html
  83. +2 −2 CURRENT/doc/org/mariuszgromada/math/janetsudoku/tutorial/package-tree.html
  84. +2 −2 CURRENT/doc/org/mariuszgromada/math/janetsudoku/tutorial/package-use.html
  85. +2 −2 CURRENT/doc/overview-frame.html
  86. +3 −3 CURRENT/doc/overview-summary.html
  87. +2 −2 CURRENT/doc/overview-tree.html
  88. +6 −0 CURRENT/java/javadoc.xml
  89. +1 −1 CURRENT/java/src/org/mariuszgromada/math/janetsudoku/BoardCell.java
  90. +3 −3 CURRENT/java/src/org/mariuszgromada/math/janetsudoku/ErrorCodes.java
  91. +1 −1 CURRENT/java/src/org/mariuszgromada/math/janetsudoku/SudokuBoard.java
  92. +6 −8 CURRENT/java/src/org/mariuszgromada/math/janetsudoku/SudokuGenerator.java
  93. +2 −2 CURRENT/java/src/org/mariuszgromada/math/janetsudoku/SudokuPuzzles.java
  94. +3 −9 CURRENT/java/src/org/mariuszgromada/math/janetsudoku/SudokuSolver.java
  95. +21 −19 CURRENT/java/src/org/mariuszgromada/math/janetsudoku/SudokuStore.java
  96. +2 −2 CURRENT/java/src/org/mariuszgromada/math/janetsudoku/regtests/RegTests.java
  97. +3 −2 CURRENT/java/src/org/mariuszgromada/math/janetsudoku/regtests/RegTestsApi.java
  98. +2 −2 CURRENT/java/src/org/mariuszgromada/math/janetsudoku/regtests/RegTestsGenerator.java
  99. +2 −2 CURRENT/java/src/org/mariuszgromada/math/janetsudoku/regtests/RegTestsSolver.java
  100. +3 −3 CURRENT/java/src/org/mariuszgromada/math/janetsudoku/regtests/RegTestsStore.java
  101. +1 −1 CURRENT/java/src/org/mariuszgromada/math/janetsudoku/tutorial/Tutorial.java
  102. +1 −1 CURRENT/java/src/org/mariuszgromada/math/janetsudoku/utils/ArrayX.java
  103. +1 −1 CURRENT/java/src/org/mariuszgromada/math/janetsudoku/utils/DateTimeX.java
  104. +0 −25 CURRENT/java/src/org/mariuszgromada/math/janetsudoku/utils/FileX.java
@@ -1,6 +1,12 @@
bin/
.classpath
.project
*.classpath
*.project
CURRENT/java/src/tests/
CURRENT/java/.settings/
src-linked
.vs/
bin/
obj/
Debug/
ipch/
*.pfx
*.user
@@ -0,0 +1,67 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{C1A7A455-9810-45A2-8C2F-584572AE6A0D}</ProjectGuid>
<OutputType>Library</OutputType>
<NoStandardLibraries>false</NoStandardLibraries>
<AssemblyName>ClassLibrary</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</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>
</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>
</PropertyGroup>
<PropertyGroup>
<RootNamespace>Janet_Sudoku</RootNamespace>
</PropertyGroup>
<PropertyGroup>
<StartupObject />
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.CSharp" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Data" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Xml" />
<Reference Include="System.Xml.Linq" />
</ItemGroup>
<ItemGroup>
<Compile Include="src\org\mariuszgromada\math\janetsudoku\BoardCell.cs" />
<Compile Include="src\org\mariuszgromada\math\janetsudoku\ErrorCodes.cs" />
<Compile Include="src\org\mariuszgromada\math\janetsudoku\regtests\RegTests.cs" />
<Compile Include="src\org\mariuszgromada\math\janetsudoku\regtests\RegTestsApi.cs" />
<Compile Include="src\org\mariuszgromada\math\janetsudoku\regtests\RegTestsGenerator.cs" />
<Compile Include="src\org\mariuszgromada\math\janetsudoku\regtests\RegTestsSolver.cs" />
<Compile Include="src\org\mariuszgromada\math\janetsudoku\regtests\RegTestsStore.cs" />
<Compile Include="src\org\mariuszgromada\math\janetsudoku\SudokuBoard.cs" />
<Compile Include="src\org\mariuszgromada\math\janetsudoku\SudokuGenerator.cs" />
<Compile Include="src\org\mariuszgromada\math\janetsudoku\SudokuPuzzles.cs" />
<Compile Include="src\org\mariuszgromada\math\janetsudoku\SudokuSolver.cs" />
<Compile Include="src\org\mariuszgromada\math\janetsudoku\SudokuStore.cs" />
<Compile Include="src\org\mariuszgromada\math\janetsudoku\tutorial\Tutorial.cs" />
<Compile Include="src\org\mariuszgromada\math\janetsudoku\utils\ArrayX.cs" />
<Compile Include="src\org\mariuszgromada\math\janetsudoku\utils\DateTimeX.cs" />
<Compile Include="src\org\mariuszgromada\math\janetsudoku\utils\FileX.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSHARP.Targets" />
<ProjectExtensions>
<VisualStudio AllowExistingFolder="true" />
</ProjectExtensions>
</Project>
@@ -0,0 +1,28 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.24720.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Janet-Sudoku", "Janet-Sudoku.csproj", "{C1A7A455-9810-45A2-8C2F-584572AE6A0D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Run-Tests", "Run-Tests\Run-Tests.csproj", "{3E9D02EA-D865-432F-A02C-B3C232DB088E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{C1A7A455-9810-45A2-8C2F-584572AE6A0D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C1A7A455-9810-45A2-8C2F-584572AE6A0D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C1A7A455-9810-45A2-8C2F-584572AE6A0D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C1A7A455-9810-45A2-8C2F-584572AE6A0D}.Release|Any CPU.Build.0 = Release|Any CPU
{3E9D02EA-D865-432F-A02C-B3C232DB088E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3E9D02EA-D865-432F-A02C-B3C232DB088E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3E9D02EA-D865-432F-A02C-B3C232DB088E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3E9D02EA-D865-432F-A02C-B3C232DB088E}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup>
</configuration>
@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using org.mariuszgromada.math.janetsudoku;
using org.mariuszgromada.math.janetsudoku.regtests;
namespace JanetSudokuRunTests {
class Program {
static void Main(string[] args) {
RegTests.Start();
}
}
}
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Run-Tests")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Run-Tests")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("3e9d02ea-d865-432f-a02c-b3c232db088e")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
@@ -0,0 +1,66 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{3E9D02EA-D865-432F-A02C-B3C232DB088E}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Run_Tests</RootNamespace>
<AssemblyName>Run-Tests</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="JanetSudokuRunTests.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Janet-Sudoku.csproj">
<Project>{c1a7a455-9810-45a2-8c2f-584572ae6a0d}</Project>
<Name>Janet-Sudoku</Name>
</ProjectReference>
</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>
-->
</Project>
@@ -0,0 +1,146 @@
/*
* @(#)BoardCell.cs 1.0.0 2016-03-19
*
* You may use this software under the condition of "Simplified BSD License"
*
* Copyright 2016 MARIUSZ GROMADA. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY <MARIUSZ GROMADA> ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of MARIUSZ GROMADA.
*
* If you have any questions/bugs feel free to contact:
*
* Mariusz Gromada
* mariusz.gromada@mathspace.pl
* http://mathspace.pl/
* http://mathparser.org/
* http://github.com/mariuszgromada/java-utils
* http://github.com/mariuszgromada/MathParser.org-mXparser
* http://mariuszgromada.github.io/MathParser.org-mXparser/
* http://mxparser.sourceforge.net/
* http://bitbucket.org/mariuszgromada/mxparser/
* http://mxparser.codeplex.com/
*
* Asked if he believes in one God, a mathematician answered:
* "Yes, up to isomorphism."
*/
using System;
namespace org.mariuszgromada.math.janetsudoku {
/**
* Data type for board entry, containing row and column indexes and digit.
*
* @author <b>Mariusz Gromada</b><br>
* <a href="mailto:mariusz.gromada@mathspace.pl">mariusz.gromada@mathspace.pl</a><br>
* <a href="http://mathspace.pl/" target="_blank">MathSpace.pl</a><br>
* <a href="http://mathparser.org/" target="_blank">MathParser.org - mXparser project page</a><br>
* <a href="http://github.com/mariuszgromada/java-utils" target="_blank">Java-Utils on GitHub</a><br>
* <a href="http://github.com/mariuszgromada/MathParser.org-mXparser" target="_blank">mXparser on GitHub</a><br>
* <a href="http://mariuszgromada.github.io/MathParser.org-mXparser/" target="_blank">mXparser on GitHub pages</a><br>
* <a href="http://mxparser.sourceforge.net/" target="_blank">mXparser on SourceForge</a><br>
* <a href="http://bitbucket.org/mariuszgromada/mxparser/" target="_blank">mXparser on Bitbucket</a><br>
* <a href="http://mxparser.codeplex.com/" target="_blank">mXparser on CodePlex</a><br>
*
* @version 1.0.0
*/
[CLSCompliant(true)]
public class BoardCell {
/**
* Empty cell.
*/
public const int EMPTY = EmptyCell.CELL_ID;
/**
* Cell is not pointing to any cells on the board.
*/
public const int INDEX_NULL = -1;
/**
* Row index of board entry.
*/
public int rowIndex;
/**
* Column index of board entry.
*/
public int colIndex;
/**
* Entry digit.
*/
public int digit;
/**
* Random seed.
*/
internal double randomSeed;
/**
* Digits still free number.
*/
internal int digitsStillFreeNumber;
/**
* Default constructor - uninitialized entry.
*/
/**
* Marker if analyzed digit 0...9 is still not used.
*/
internal const int DIGIT_STILL_FREE = 1;
/**
* Digit 0...9 can not be used in that place.
*/
internal const int DIGIT_IN_USE = 2;
/**
* Cell is not pointing to any cells on the board.
*/
public BoardCell() {
rowIndex = INDEX_NULL;
colIndex = INDEX_NULL;
digit = EMPTY;
randomSeed = SudokuStore.nextRandom();
digitsStillFreeNumber = -1;
}
/**
* Constructor - initialized entry.
* @param rowIndex Row index.
* @param colIndex Column index.
* @param digit Entry digit.
*/
public BoardCell(int rowIndex, int colIndex, int digit) {
this.rowIndex = rowIndex;
this.colIndex = colIndex;
this.digit = digit;
randomSeed = SudokuStore.nextRandom();
digitsStillFreeNumber = -1;
}
/**
* Package level method
* @return
*/
internal int order() {
return digitsStillFreeNumber;
}
/**
* Package level method
* @return
*/
internal double orderPlusRndSeed() {
return digitsStillFreeNumber + randomSeed;
}
}
}
Oops, something went wrong.

0 comments on commit 0fd95ad

Please sign in to comment.