[Community puzzle] Advanced Tree

I edited testcase 9 to match the sorting description:

.
|-- much
|   `-- amaze
|       |-- Hates
|       |-- Memes
|       `-- Who
`-- such
    `-- wow
        |-- .much
        |   |-- pain
        |   |   |-- Dont
        |   |   `-- Suffer
        |   `-- I
        |-- Doge
        |-- Love
        `-- We

6 directories, 9 files

The previous version was:

.
|-- much
|   `-- amaze
|       |-- Hates
|       |-- Memes
|       `-- Who
`-- such
    `-- wow
        |-- Doge
        |-- Love
        |-- .much
        |   |-- I
        |   `-- pain
        |       |-- Dont
        |       `-- Suffer
        `-- We

6 directories, 9 files

It should have no incidence on previous solutions cause the case insensitive sort that most people seemed to use in replacement provides the same order than the one described in the puzzle for validators.
The previous solutions will now fail at testcase 9 but itā€™s not a big deal.

or maybe you should stop to modify puzzle each time you donā€™t like itā€¦

when a puzzle is solved by lots of CGers and with so many stars ā€¦ there is certainly no problem in it

1 Like

The problem was reported already twice in this thread that the description didnā€™t match what was actually expected by testcases.

Ok. We gonna try to avoid to start another drama here.

I have not solved this puzzle, so I canā€™t judge personaly of the good of the made changes.

It seems, from what said several users who solved it a long time ago, that the statement and the solution also has been changed. So there are possibly inconsistencies in the puzzle.

However @pardouin , making modifications that can affect the validity of the solutions of many users, is not a thing that can be done ā€œlike thisā€, simply saying ā€œI broke all of your codeā€ on the forum afterwards.

So please keep in mind that:

  • Any modification to a contribution that is not yours must be notified on the forum AND on the contribution page (Not everyone use the forum).
  • Any modification that is more important that correcting a typo must be discussed with the author if possible, or with the community.
  • The ā€œThereā€™s a bug in the puzzleā€ bias also apply to experimented users. So please think twice before making potentially irreversible changes.

Perhaps that should be added to the guidelines or somewhere @TwoSteps ?

If I posted here about this modification it was mainly to get feedbacks cause Iā€™m aware that impacting previous solutions is not totally harmless.
(I also posted the previous validator so that it can easily be edited back.)
But one sure thing is that the puzzle couldnā€™t stay as it was.

The other option is to keep the old testcase and modify the description of the sorting process, it wouldnā€™t affect any previous solution.
I chose the first option cause I didnā€™t want to alter the original authorā€™s puzzle but I donā€™t mind if people prefer the second option.

1 Like

No big issue here. I think youā€™ve been a bit hard with @pardouin

Iā€™m fine with top moderators editing puzzles without prior formal agreement from the author or other players in the community if theyā€™re sure about their modification.

However:

  • yes, itā€™s better to notify it in the contribution comments (so at least the author gets a notification and people can check the history of a contrib). Ideally, our system should prompt for a commit message.
  • yes, it doesnā€™t hurt to first suggest the change before applying it (even if there is no reaction)
  • yes, it seems better to modify the description than the testcases since it impacts previous solutions

About the change itself, perhaps @Shoko84 can weigh in?

The author hasnā€™t started the questmap so it means that heā€™s not active at the moment on CG.

Iā€™ll put back the problematic testcase as it was and change this part of the description:

The tree needs to be sorted in ascending alphabetical order , letters in lowercase having priority on uppercases and without considering the leading and first character ā€˜.ā€™ (dot) from hidden files or directories names.

for this:

The tree needs to be sorted in ascending, alphabetical, case insensitive order and without considering the leading and first character ā€˜.ā€™ (dot) from hidden files or directories names.

2 Likes

This is a good puzzle. It nearly killed me but it is a good puzzle. Iā€™m not sure what was wrong with my earlier attempts, but this time my issue was the logic I used to skip hidden files/directories would miss files that were located in the root directory (i.e. ./.File8 ).

Hi all,

Iā€™m stuck on the validator ā€œLimit Flag Validatorā€. Every tests or validator are OK but not this one.
Does someone know its particularity ?

Thanks

It involves a maximum depth of 6 and a limit flag of a number between 2 and 5. You may try building a custom case to test your code.

Iā€™ve tried to test and every things seems fine to me:

.
-L 4
6
./Directory1/Directory2/Directory3/Directory4/Directory5/File1.txt
./Directory1/Directory2/Directory3/Directory4/File2.txt
./Directory1/Directory2/Directory3/File3.txt
./Directory1/Directory2/File4.txt
./Directory1/File5.txt
./File6.txt

=>

.
|-- Directory1
|   |-- Directory2
|   |   |-- Directory3
|   |   |   |-- Directory4
|   |   |   `-- File3.txt
|   |   `-- File4.txt
|   `-- File5.txt
`-- File6.txt
4 directories, 4 files

Am I missing something ?

How about a case similar to the test case but ā€œFile6ā€ has further subdirectories/files?

Same things:

.
-L 4
9
./Directory1/Directory2/Directory3/Directory4/Directory5/File1.txt
./Directory1/Directory2/Directory3/Directory4/File2.txt
./Directory1/Directory2/Directory3/File3.txt
./Directory1/Directory2/File4.txt
./Directory1/File5.txt
./Directory6/Directory7/Directory8/Directory9/Directory10/File6.txt
./Directory6/Directory7/Directory8/File9.txt
./Directory11/Directory12/Directory13/Directory14/Directory15/File7.txt
./Directory11/Directory12/File8.txt
.
|-- Directory1
|   |-- Directory2
|   |   |-- Directory3
|   |   |   |-- Directory4
|   |   |   `-- File3.txt
|   |   `-- File4.txt
|   `-- File5.txt
|-- Directory11
|   `-- Directory12
|       |-- Directory13
|       |   `-- Directory14
|       `-- File8.txt
`-- Directory6
    `-- Directory7
        `-- Directory8
            |-- Directory9
            `-- File9.txt
12 directories, 5 files

How about:

.
-L 4
16
./Coding/Go
./Coding/Clojure
./Coding/Bash
./Coding/Dart
./Game2/NaN
./Game2/TheseAreNumbers/97
./Game2/TheseAreNumbers/Here/64
./Game2/TheseAreNumbers/Here/721
./Game2/TheseAreNumbers/Here/Or/2022
./Game2/TheseAreNumbers/Here/Or/Not/Php
./Game2/Digits/6
./Game2/Digits/1
./Game2/Digits/2
./Game1/TypeScript
./Game1/ObjectiveC
./Game1/JavaScript

I donā€™t see the error except if digits should be after letters:

.
|-- Coding
|   |-- Bash
|   |-- Clojure
|   |-- Dart
|   `-- Go
|-- Game1
|   |-- JavaScript
|   |-- ObjectiveC
|   `-- TypeScript
`-- Game2
    |-- Digits
    |   |-- 1
    |   |-- 2
    |   `-- 6
    |-- NaN
    `-- TheseAreNumbers
        |-- 97
        `-- Here
            |-- 64
            |-- 721
            `-- Or

7 directories, 14 files

Interesting. Iā€™ll send you the validator in private message here.

Thanks @5DN1L , I figured out the problem, it was on the sorting part is was not working because of digits. The exemple above is more representative of the problem

1 Like

I passed all but validator 8 (ā€œHidden Files w/o -aā€). What is the difference between it and the corresponding test case?

In validator 8,

  • There is a hidden file.
  • There is a non-hidden file not under any directory.
  • The file names start with uppercase.

Found the bug. Thanks.