ARC_Kaggle
ARC_Kaggle copied to clipboard
Implement EvolvingLine
This issue targets at tasks that involve evolving lines. Some examples (not all) are tasks 790, 749, 748, 703, 679, 629, 605, 585, 573, 457, 344, 322, 283, 236, 231, 201, 198, 59, 23.
TODOs:
- ~~Add the option 'jump' or 'skip' when encountering a fixed color. The line would just continue its way without coloring the fixed color.~~
- ~~Add the option 'split'. The line would split in two when encountering an obstacle. See task 790 as example.~~
- Turn after x steps. See task 749 as example.
- Consider the cases in which the source color is different than the line color. See task 605 as example.
- Add diagonal evolving lines.
- Be color independent, as in task 236.
- Add rules for the borders.
- Consider sources that are not only a pixel.
- ~~Modify direction after turning.~~
- ~~Switch color. See task 435 as example.~~
A prototype with some ideas was implemented in https://github.com/alejandrodemiquel/ARC_Kaggle/commit/e86627ebb6e0097c15e38413cb4fc24023f83e47
In commit https://github.com/alejandrodemiquel/ARC_Kaggle/commit/3af9e16992b786db5c6669a069f6c5080c2f244d I uploaded the first working version. It solves tasks 344, 573 and 629.
It is not included in getPossibleOperations
yet, but one can execute it by doing:
f = Utils.getBestEvolvingLines(t)
pred = f(t.testSamples[0].inMatrix)
Tasks 679 and 790 are now solved after this commit https://github.com/alejandrodemiquel/ARC_Kaggle/commit/c29595171a5fd403b11a918b33715c19b6e0877d
It deals with modifying the direction of the line after turning and with splitting the line in two when an obstacle is found.
Task 524 seems to enter an infinite loop:
The problem with the task 524 was the definition of cic
. I will leave it as cic=t.commonChangedInColors
for now, but it would be nice to think how to expand it in order to cover more cases. For now, it doesn't affect any of the solved ones.
See commit https://github.com/alejandrodemiquel/ARC_Kaggle/commit/07d81be0436a076467a9d08e0a64b195801e4f57 for update on "convert", solving task 435.