C
C#2y ago
Sven

❔ I want to find objects within objects. using composite pattern

Hello I have an sudoku application that can check weither an number is correct or not. The current sudoku formats are regulars (4x4, 9x9 etc), jigsaw and samurai sudoku's. Now I want to check weither an samurai sudoku number is correct. The only problem is that I have build up my sudoku's as followed: regular & jigsaw (so both for example 9x9 grid) : have 27 Clusters with each 9 cells (9 rows with 9 cells, 9 columns with 9 cells and 9 blocks with 9 cells' samurai: have 15 clusters (1 cluster is 1 sudoku because samurai has 5 total sudoku's so times 3 because of the rows, blocks and columns) with children each 9 clusters and there in each cluster has 9 cells. the problem i'm heading is that the check works for regular and jigsaw but not for samurai because of the build. I don't want to change anything to the build but I want to ask how to solve this. Anyone have any idea how I can iterate over the clusters in clusters. I´ve tried recursion but did not work yet
this is the cluster check that will check if the cells are correct
this is the sudoku check that I want to edit so it can also filter out the clusters in clusters and not only the cluster with cells
this is the cell check that determines weither a cell in the row, column or block number is even with your cell
2 Replies
Sven
SvenOP2y ago
Basically the only thing that should be edited (I think) is the findAll so that it can accept Clusters in Clusters and not only Clusters with cells
Accord
Accord2y ago
Looks like nothing has happened here. I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server