Jonny wants to play Frogger. However, he's not very good. In fact, he will only try to move forward, and only after the platforms have moved.
Find out if Jonny's frog manages to reach the end of the path or if it dies on its way.
The program will be receiving as input a Frogger grid composed by
1s, with the following format:
- The grid will be of a random width and length, and at least 3x3
Frepresents the starting position of the frog
- Every first and last line of the grid will be composed by only
1s, and will not move, and the frog
Fwill be placed at random on the last line
- Every intermediate layer will always be moving, and will have a
>at the end of every line indicating if it moves left or right
Replacing these symbols with your own is allowed, as long as they're all distinct and you specify the replacements in your answer.
The input may be in any compatible format (string with line breaks, array of strings, array of characters, ...).
- Every turn, all platforms will move one square, based on the direction indicated by the
- Platforms reappear on the other side of the grid if they get pushed off "screen"
- If the frog is on a moving platform, it will move along with it
- After that, the frog will jump one square towards the top row. The frog will move every turn.
- The frog dies if it jumps in water (
0) or it touches the side of the grid along with a moving platform
Your program has to output a truthy value if the frog survives and a falsy value otherwise.
This is code-golf, so the shortest answer in bytes win. Standard loopholes apply.
11111 00111> 00101< 1F111
11111 10011 01010 1F111 11111 10011 0F010 11111
11111 11001 F0100 11111 11111 F1001 10100 11111
11111 1F100 01001 11111 1F111 11100 01001 11111
11111 00100< 00100< 1F111
11111 01000 01000 1F111 11111 01000 0F000 11111
11111 10000 F0000 11111 11111 F0000 10000 11111
11111 00001 00001 11111