[Community puzzle] Code your own Automaton2000, step 1

Hello, I am trying to solve the puzzle and I can not pass tests 5 and 4.
For test 5 I get the answer:
trying to hack
Are you listening Automaton2000?
And here Automaton 2000?
And here Automaton 2000?
And here Automaton 2000?,
witch seems consistent with the puzzle statement.

For test 4 I get:
one two one two one two,
which also seems logical, since the depth of the tree should not exceed the number of words in a sentence in this case. I do not see how you can get into infinite loop from here.
Surely, I am missing something in the description of the puzzle.
Thanks for your feedback.

The tree can be recursive. This is the meaning of the test 4.

Thanks for replying.
Can you sketch a short example of the tree is this case? As I understand it, the moment an end node is encountered, a line should be printed, so you go down the tree to reconstruct the whole sentence, which is “one two one two one two”, where the last “two” is the end node.

For test case 5 I still do not see why the output is wrong - there are 5 strings that contain or are “Automaton2000”, so five lines are printed in the solution, and they seem to be the right ones following the logic of how the tree is updated.
What am I missing?

Maybe someone else could answer? Automaton2000? :slight_smile:

In the case of a sentence like “one two one two one two one two”, you’ll have a tree like this:

    one 1 

    two 4

    one 3
    __END__ 1

Hi !
I pass all the tests, but fail at validator 2.
Could I have a clue about what is specific to this validator compared with the tests ?
Thank you !

If i remember well, you don’t handle the character : correctly.

1 Like

Thank you for quick your answer !
I go back to work.

Thanks for replying. Solved it by taking an alternative approach to building/using the tree, and making use of the __ END __ indicator.

I was also wondering how does the test 4 expect “infinite” sentence. But this answer clarifies the problem a bit. Maybe the better term should be “directed graph” instead of “tree that can be recursive”. The last one sounds like oxymoron to me :slight_smile:

Am I the only one to have been confused by the fact that the statement talks about a tree (10 occurrences) while it’s actually a directed graph (corresponding to a Markov chain)?
Also, I really don’t see the point of having added some spaces between the login and the “:” at the beginning of the chat lines in some testcases.

A tree is a graph without loops.

Yes I think you are the only one :slight_smile:

@nicola1: Yeah (+ connected to be accurate) but there are loops in this case, that’s precisely the reason why the statement says “Automaton2000 has a security and stops at 30 words at maximum. You don’t want to do an infinite loop !”

@Kirbiby: Maybe, nevertheless this problem has only been solved by 112 people in almost two years while it’s not that difficult.

1 Like

The name of this puzzle implies that there should be a “step 2”. Where is it?

Blocked somewhere into my side project stack.

:slight_smile: time to build your Automaton3000 that creates the codes for your ‘side projects’… :slight_smile: