Skip to content

Chain parser #768

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
5 of 8 tasks
kyoyama-kazusa opened this issue Apr 16, 2025 · 0 comments
Open
5 of 8 tasks

Chain parser #768

kyoyama-kazusa opened this issue Apr 16, 2025 · 0 comments
Assignees
Labels
Area-API The issue is bound with APIs. Kind-feature The new feature to support it!
Milestone

Comments

@kyoyama-kazusa
Copy link
Owner

kyoyama-kazusa commented Apr 16, 2025

Implement ChainFormatInfo.ParseCore method.

Test code:

using System;
using Sudoku.Analytics.Construction.Components;
using Sudoku.Concepts.Coordinates.Formatting;

var str1 = "r4c4(6) == r4c1(6) -- r4c1(8) == r4c9(8) -- r9c9(8) == r9c4(8)";
var str2 = "(6)r4c4=(6-8)r4c1=(8)r4c9-(8)r9c9=(8)r9c4";
var str3 = "6r4c4=(6-8)r4c1=8r4c9-8r9c9=8r9c4";
var str4 = "r3c3(1) == r3c3(2) -- r3c4(2) == r3c4(3) -- r4c4(3) == r4c4(4) -- r4c3(4) == r4c3(1) -- r3c3(1)";
var str5 = "(1=2)r3c3-(2=3)r3c4-(3=4)r4c4-(4=1)r4c3-1r3c3";
var chain1 = Chain.Parse(str1, ChainFormatInfo.Standard);
var chain2 = Chain.Parse(str2, ChainFormatInfo.Eureka);
var chain3 = Chain.Parse(str3, ChainFormatInfo.Eureka);
var chain4 = Chain.Parse(str4, ChainFormatInfo.Eureka);
var chain5 = Chain.Parse(str5, ChainFormatInfo.Eureka);
Console.WriteLine(chain1.GetType().Name); // AlternatingInferenceChain
Console.WriteLine(chain2.GetType().Name); // AlternatingInferenceChain
Console.WriteLine(chain3.GetType().Name); // AlternatingInferenceChain
Console.WriteLine(chain4.GetType().Name); // ContinuousNiceLoop
Console.WriteLine(chain5.GetType().Name); // ContinuousNiceLoop
Console.WriteLine(chain1.ToString(ChainFormatInfo.Eureka)); // 6r4c4=(6-8)r4c1-8r4c9=8r9c9-8r9c4
Console.WriteLine(chain2.ToString(ChainFormatInfo.Eureka)); // 6r4c4=(6-8)r4c1-8r4c9=8r9c9-8r9c4
Console.WriteLine(chain3.ToString(ChainFormatInfo.Eureka)); // 6r4c4=(6-8)r4c1-8r4c9=8r9c9-8r9c4
Console.WriteLine(chain4.ToString(ChainFormatInfo.Eureka)); // (4-1)r4c3=(1-2)r3c3=(2-3)r3c4=(3-4)r4c4=4r4c3
Console.WriteLine(chain5.ToString(ChainFormatInfo.Eureka)); // (4-1)r4c3=(1-2)r3c3=(2-3)r3c4=(3-4)r4c4=4r4c3

To-do list:

  • Basic format: a == b -- c == d
  • Eureka format
    • aA=bB-cC=dD
    • aA=(b-c)B=dC-(e-f)D
  • Continuous nice loop aA-bB=cC-dD
  • Forcing chains
    • Strong-start FC
    • Weak-start FC
@kyoyama-kazusa kyoyama-kazusa added Area-API The issue is bound with APIs. Kind-feature The new feature to support it! labels Apr 16, 2025
@kyoyama-kazusa kyoyama-kazusa added this to the 3.4.2 milestone Apr 16, 2025
@kyoyama-kazusa kyoyama-kazusa self-assigned this Apr 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-API The issue is bound with APIs. Kind-feature The new feature to support it!
Projects
None yet
Development

No branches or pull requests

1 participant