Something I found while looking through some old files. It seemed like a neat idea for a code golf challenge.
The intro
One of the most popular events at the annual Cyclist's Grand Competition for Charity (CGCC) is the rocket bike parcours. The rules are simple: Inspect the parcours and place a bet on wheather is it possible to reach and exactly stop on the finish line. The drivers who bet that it's possible then have to prove it to win. If they can't prove it, the drivers who bet against it win.
The parcours
The rules for the parcours are as follows:
- A parcours consists of uphills, downhills and flat bits. In the examples, it's modelled as a sequence of
/
,\
and_
respectively. - The bike starts with a speed of 0 m/s (i.e. before the first character of the sequence).
- The down-/uphills accelerate/decelerate the bike by 1 m/s.
- On the flat bits the driver must either speed up or slow down manually, again, by 1 m/s. They mustn't do nothing.
- If the bike has a speed of 0 m/s at the finish line (i.e. after the last character of the sequence), the parcours was driven correctly.
- The finish line must be reached.
- The speed must remain >= 0 at all times. If it is/becomes 0 at any point, the next piece of the parcours must accelerate the bike, either through a downhill
\
or through a flat bit_
where the driver accelerates.
The task
Given such a parcours, take it as the input for a first program and output whether it's possible or not to drive the parcours correctly according to the rules above. If yes, take the sequence as an input for a second program and output a sequence of instructions for the driver on what to do on the flat bits. In the examples, +
and -
are used to signalize acceleration and deceleration respectively.
The rules
- This is code-golf. The shortest answer wins.
- Submit one or two program/s that validate the parcours (validator) and generate the instructions for the driver if valid (generator). If two programs are submitted, they are scored seperately and independently from the one program submissions.
- The I/O format may be freely chosen. All characters may be substituted freely.
- The generator program only needs to work on parcours that can be driven correctly.
- The input length is not bounded.
The examples
Input is taken
Input:
\_///
Formatted for clarity:
/
/
\_/
Validator output:
Falsy (The driver will come to a stop before the last uphill)
Input:
\_\__/
Formatted:
\_
\__/
Validator output:
Truthy
Generator output:
--+
Input:
\_\_\
Formatted:
\_
\_
\
Validator output:
Falsy (The driver will finish the parcours with at least 1 m/s)
More examples:
Invalid:
/_/\ (Driver can't go uphill with a speed of 0 at the start)
\/_\\/
/\_\//_\
_\/\///_\\
/__//\/_//_\
/_\\\_\/_/__/\_/_\\\\\_\\/\_\//\\\\/\_///\/__\_\_\/_\\\_\//__//_\__/\\___/_\/_/\_\_/\\\\_\_\_\__\_\\
_/_//_\\//\\\/\/_\/\__\\__//\//_\/_\\\___/\\___\_/\_//\\_\\__\/\\_/_//_/__\/_\\/\\___\_\\\\//_/_\\_\\\_\/\___\_//\\/\\\_/_\///__\//\\\/\\/_\\__\_/\\\/_/_/_//_/_/\\//_\/\/_/\\_\\///_/_\\__/_______\/_///_//_/__//__\_//\\/\\\\\_\\\_\//\_\__/\\\/_\\_\/\_\/_\\_/_\_____/\\_\_/_\/_/\/_/\_\/_\_//_\\//__//\//\//\______\//\_//\/_/\\\/_\__\\/__//\\/\\_\\//_/\\_/_//_\\/\\_/\\/\__/\_\_\\_\_\//__\__\\/_\///___\//\\/\__\/\\\\//__//_/_//\__/\\/___/\\\__\/_\__/_/_/\/\//_\\\/\_/_/_\/__\\_\//___///_/_\//__/\___/_\_/_/\_/_\_/\\\\//\\\\_/_\\/\/__\\/_\_/\//\\_\_\_\_\/_\_//\__\\////////\//_//\//\/\\_/_/___/\/\_\/____/____\\\_///_\_\/\__/\//\_/\\/_/_/\\__\\/\\\\///\//__/\_____\__/\__/\\\__/\\_\/\_\__\/_\\/\_\/\/\\\/_\_\__//_\\/\_\/\\\//\//__\_\_\__\__/\/_\_\_\_/_//\\\\_//\/__\\\\\\___/\/\_\\\\___\\_\\\/\_\__/\_/_/__/__/__\\//_____//_//\___\/\/\/\_\__\__\/_/_/\_//__/\\___/_/_\\/\__\\__\__/\_/_/////\\//\//_\\\\\_\\\\_/\/\_/_//\_/////_///_/\/__\\/_/_\_\/_/\_\__\/\\\_\__/__/_//__\\___/\/\//_\/_\\/\/////__\//_\/__////__\\_//_/\__\/_/__\___//\/\/_/\/\//_\___\/\//\///\/__\_/_/___\/\\_\//__\\\__\/\__//_\\__/\_\/\//\/\__//__/_____\\//__/\\\\\\//_/\_///\/_\\\__/_/\__/\\\//\_\\/\\_\///\_\/\__/\//__\\_\/\\__\__\_/__//\/___\\__/_/_/\__//_//_/\/\_//\//__\\__//\/_///\\\/\__/_\_/__/\__\_/\_/_\\//_/\\/__///\_\/_//\_\\____\_\_\/////_\/_/\\\_//_\_\\\\___/____\/\/_\/_////_\__/_/\/\//_/_\_\__\////\///\_/\/_\____\\//\\__\/\/_\_\_\/\/\\\\/\\__\/_\///\__/\/\\_/_//_//\/\/_////\\\__\\/_/\_/\_\//\/_/_/__\//_\/_\//\\\/\/\_/__\\_\_\//__\_\/_/\/\\\\/__\_/\///\__/____\//\///\_\/\_\/__/\\\__\/\\/\/\_//_/_\_\\__/\/\\_/_\__/\/\/\___\\//_/_\\//__\_\\\\/\_\___/__\\//\\/\_\_\/_/\//\/\/__\_/_______/\_\\__\/_/_/_/\_//__\////\/__//__\/\/\///\_//\/\_//\_//\\_///_/_/__\___\/\/__\\\//__/_\_\_\///_\\_\/_/\\__/_/\\/__/_\/_/_\//\\_\\/__\\\\\/__\______\/_//_/\\\/\/\//_\_//\/\\_\\////\_/\_\\\\/__///_/\\___\/\_\//__//_\__\__/\/\\\/\_/\/_\/_/\__\\/_/\__\/\\/_\\_/\/_\/\_\/\\\\_\_/__\/_/\\\_\/\//\_//\//_/\_/////\\\/__///___/\__//_\\_\\\/\\\___/\/\/\___\____/__////\__\______/__/_//_\\\___//_\_\\\/\\/_/\\_\_/__\__//\/_//_///\//__/\//_/_/_/_/\_\____/_//_____///_\___///_\/__\\/\\//\\_\_\_\_//__//\\__\\_\_/_\//\//\/_\_/_\_//\/\_/_\_/\//_///_/_/\\/_/_/_/_\_\//\_\/\/\/////_/__//\/__\//_\_/__\__\_\_/\\_/_//___/__/_/\///\_\/\/\\__\\\__\/\\/\\/\__//\\\/_/\\/\_\/_//___\\_\/////_\/_\_\__/_//\\\/__/_\\\/\/\_\/__\/\_//\/___/_\\/__\\/_/\\\\/\_//_\/_\/\/\__\\_\\\__\\_/_\///_//_\__/_\_/__///_\__\\_/_\/\___\//_\\_/\\/_/\__/\/_/_\\\\\//_//_\\_///\\\/_\\/\\__\\/__/\_\__\/\//\/_\/\/_\\\/\__\___/_/\/_\\////\\_\___\/\_/__/\/\\__//\//_/_/\\\_/\//\//\/\/_/_\\_/\/\//__/\\/\/_/_\//\/\\_/\//__/\/\////\//__/_/\\\_//_///____//_//\_\/_\_\_\\/\\//__///_\__\/_/_\\/\\\\_\_/\\/_\\_//\\/\\/\\/\_\//_\\//__/_\__/\\_\/\/_/__/\\_\\\_/__/\\\_\_/\___\/_\\//__//_//___\/\/___//_\\___\\/_/_\\_/_\__\/_\_//\_\__/_\//___\\\__//_/__\\\\_/\/\__///____\_/\//_/_\_/___//__\\//\/_/\_\_\\_\//_\_/\_/___\___/\/_//\/_\\\\/\\_____/\/_\/_\_\///_\_/\\//__\__//_/\/\\//___///\\///__\__\////_\\/_/_/_\\\__/\_\/_/_//\_\//_//___/\_/_\\_\_\_///___\/_\__/_/\\/\/_/_\__/_\_/_\__///\\\_/\//_\\_/_\\/\///_\/\__\/_///_\____\/_/\\_//\\_\\_\_\\_\/\\\\\\_\///__\/__\_//\\\/\//__\_\\\_/\/_\_\/\/__/_/\_/\/_\_\__\/_\_//_/\/__\_/_/_//_\/\_\\/_\\\//_\_/\\\\\\_\_/\\/_//_/\_/_/\/\\__/_\/\\\\__/\/_/\//////\\\//\___/_\_//__\__/_/_/_//_\_//\///_\\_\//\\/\//_\_\/\_/_///\\\\_\_\\/_/_\\//\/\/_//\//\_/\_/\\_____/_/\/\/\_\__\///\__\/_/_\\\_\_\___//\__/\_/__//\____/\\\_/\\/__\/_///_//\\_//\__\\_/\/_\_/_\_\\///___/_///\//_/___\///\\\\/\/\\/\___/_/__/\/__/_\_/\/_/\__//_//____\/\\\//_\__/__\_///___///_\//_//__////_\//_//\\___/\/\//_\/_\/\\\\_\//_\\___\_\/_\\\//_\\\/\/\//__\\_\\\_\\\\/___/\/_\____/___//_\\\_/\_\_//_/\_\\_/_\\\__\/_//\\/_/\_/\//_/__////______/\/\/\/_//_\\/\______\__/\/__\__////__/\\__\\_\//__//\_\\\/_//\\_\__\\_/\\/_//\\___/_\///_/\__/_/\///\\//__/_/_/_/////\//\_\\__\_\/\//_/_\\//___/__\/\\___\/\_\__/_/____\__\\____/____/\_/\\///\/\_\\/\\\\//__\//\_//\_/\\_\_/_\/\//\\__\\_//\/_\_/\/_\__/\//\__\/___\__\//\/_\__\__\\//_\_/___/\\_/_//\\\/\/__/_//\/_\_/\/_\/_\/_\\\_//\\__/_//\\/\\_\_\\__/\\\//\__\/\//_\_\/_/_/\___\\\/\\_/\/__\_\_\/\\//_\/\//\_/___/_\\\\\\___/\\_\///\/\_///_//_\_/\\__\__\/_//_\_\\\\/_/__\/\/____/\\\\_\\_/\/_\//_\_\//\_////\/_\___///__\/__/_\/\_//_\\_//_\_\///\/_/\__/__\\_\___//_\____/\///_\/_____\/___/\\\///\/_\/_//__/__/\___\/__//\_///\__///_/_\/_/\_/\_\/\/\\/\///_/_/\\__\_\_\\/\//\\\/\\___//__/_\__/_\\\_\//_/_///\/_///_\//\/\_/\\__\/_\/\_\_\\_\_/__\\_\_\_\__\\__/_\//\_//\_\\//\/___\//__\\/__\\\\//_\_\/_/_/_//_\\_//____\\\_/\\_/_\\\/\\\\\___///\/\__\___\__/_/____/\/_/_\_//\_/\_\___/_/\\_/_\\\\___\/\/\\\/\/\_/___\\_\\\\\\_//////_/_\\\\/\\\\/_\\///\/\/\/\/_\_______/_/\/\/\/_\____\\_\_//\_//__\\\\/\\\\//_\\_/__///_____//\\/_/\\____/__//_\_/__\_\/___\\_\\_/___\////_\__\_\_/_\\\/_\_\/\\_\\/_///\\_//_\_\__/_\/_//_\\///_/\\/\/_\/\_/_//\/\\//\///\\///__/\\//_/\/\_/\_/_\/____/\_\_\//_//_\/\____\_/\\__//\____\\\\__//_\_/_/_/_//\_\\\___\\/\\/\\_///\__\\__\_/_/\/\\__\//\/__/\//_\\__\\__\\\\__\/_\/_/___/\_\\/_\/_\\___///\\_/\_/\__/////_/\\_\_\_//\//\_\__\_\__/__\\//\\_/\\/_\/_/_\/_\/__\\_\\__//\_\__/_/\_\/\_/\////////_///__\_/_\/_/\\\_/\/\\\\/_\\//\////___/_\/\/_\/_/_//___/\/_\__//\///_\//\\//\\//\\___/\\_\\/_/_/\\\/\//\\_\///\__//_\\//\\\_/\/\/\//_///__\_/\\\\\/\\/\\\\\__\\\\\__\_/\\__////\_/\_\/___//_/_/\//\_/\_\\\\/_/_\\/\\/_//\_/\/_\\__//_/_//\/\_/\_\\/_\///_//_///_\/\__\__\_/\\\\/__\_///\\\//_\_\_//__\///__/\/_/\_/\___\//_/\/_\/__\_/_\///_\\/\//\/_/\//\/\///\/\__\__/\\_\__\/\_\//_/_/____//\_//_\\\_\/\\/_/\/\\_/\\\_//__\___\//\_\_\/\//\\/\_/\//_\_/\____///\//\/_/\/\_/_/\///___\_\_\//__\_\__\///\\\_\//_\\/_\\\__/\/\___\\/__//_\\_\_\/_\/__/_\_/_\///____\/\_/\\___\/_\_\_/\_/\\_\//\\\_/\/\/__/\/\__/\__/\//\_\\__/_\///_/__\__\\\/_\\_\___////__\____/\_///\/\_\/___\/\\/\/__\____\/__\__\_/\/////___\\/\\//__/\_\_/_\_\_\____\\/\__\\\/\___\\__\__//\\/\//_\/____\\_//_\_\\\\__//_\/\\/_/_/\_\\\____\\__\//_/\_/___\\\____\_\\\/\\//\_//_\_\\___\\//\/__///_\/_///\/_/_/_/_\____/_\_\___/_\\/\____/\\_/_\\/_/\//\_//___/_____/__/\_\_\_///___/\___\\_/\/\\___\__\/\\\\/\\///_/\\/\\\_\\__\_/\/_\_\\\\_///////\/_/\\\\/\/_//\/__/\_/////\_/\\_/\/_/\///\/\\_//\\_\_\/\\\__\\/_\\_\\\__\/_\_/_/\_/\_\_\\\/_\\\_\_\\___\__///___/\__/_///_\_\__/_\__//\_//\_\_\_\_\/_//_/\\\\////_/___\\_____\\___/\/\\_/___\\\/_\____/\__//////\\\/\_\\__\/_/_/\\\/\/\\_\\\/_//\///______\/_\_/__\\\_\\\____\///____\\\\/_/__//__\/\\/_/_\_\_\_\///_\\__/\\_\/_____/\//__\_///_/\\/_\\/\_/\_//\/\////_/\\\\/\/\\\_\/\_//\/\__/\__//_\/\_//\_\\\\\//\\_\\/\_\\/_//\//__/_\\\\\\_/\____\\\__\\_//\/\___/\/\__/____/\/_\/_/_\_/\__\/\/_\//\_\/_\_\\\__\\/_\///___\/\/\__/__////\__/_\//\\\_\/\//\\_\_/\\__\\///_///\\\_\//__\/\_/\///__\\__\_/_//_\_\___///__/\\\\\\_//__\\_//\___/\//_\\_\\/\\/_/\_\\/\/\\/_\\_\_\/\_/\//\__//////__\_\/_\/\\//_\\\\\\\/_\\\/_//\_/\\/\///_\_\_\\/\____/_/\_\\__/\//___/\//\__///_\/____/_//_\///__/_\/_\\_/__/\/__\\\__/_\_/_/\_\\\_/\_\___//_\/_/\__//////\//\_\\\_/__/_/\\/__\\__//\/_/_//_/\/\_\/_/\__/////_/\\\/\\_\_//\\_/___/\\///__\\/\__\/_\\/_\__\/__\_\/\\_/\__\/\___\\__\__//__\//\//_//_\//_\/_/\\_\\_\_/__//\\\//_/\__///\_\/\\////\\__/_/_///\_\/\_/\_//_\///_/____\\_/\/___\/_\\_\//_\_\//\_//__\_/_/__\_\/_/__\\///\\/\\/\/////_/_/_/_///////__//\__/__//\////\_/__\__\//\_\\//\\_/\__\\/\/\/_\\\\/\_\\\/\/___//\/___\__/\\_\\\\_\\_/\/\_\/\////_//_\_/\//\__//__\\\\\//\\\\\__\_\/\_\//\///\/\\_/_/\/_/___/__\___\/_/_/_\_/\_\//\/\____\\_/\\/_\/\__/_______\\_\//____\__//__/___\\//\\////\/\__\__\\___\\_/____\_/_\/\/_\\__////\\\\___/\\/\//_///_/\___/_////\//__/\__\_/_//\//_/\_\\__//\//_////_\_/\_///___//_\//_/\//__/\_/\\_///\\/\\_/_/_\/__/_\\\__\_/\//\\/_\___\_///_/\/____/_\____///\__//__///\_/\\___\_\_/\/\\/\//\_\/_\\/\\_\\/_//\/\_\__\//_\__//\/__/\/\___/\/_\\_/\_/\_\_/\__/_/\\__/_\__\__\_/\\\__\_/_/\\_\\/_//\_/_\/__\__\_\\__//_\\__/_/\/__///_/_\_/\\\__/_\_____\\/_\\\_\\\/_/_/\/___\\_//\_\_//__\\__/\_/////\___\__\/_/_\/_\/\/\\___//_/_\\__/\/\\///\/\___/__/__/\/__\\//_/_\_/_\/___/__//\\__\\\//\/\\\__/_/\/\\_/_\/\/__/\\/__//_/_/\/\///__//\_/\\\__/___\__\/\\/\_/_\\/_\_\/\\////_//\_\_//__\\/\_\\/\\_\/_\_\/__\\__\\\_/_\\/\/_\\\\//\_\_\\///\\/\/\_\\\\__\//_\/__/\/\___\___\\//\\__\__/\/_/\//__\/\/\\\////____///\_\_\\///\/__/_///_\\/__\__/\/__\\\\_\\_\/___\\_///\\_\_\\\\__\_\___///_\/_/\\\\__\\\_/\//\/_//\\\//\\//\/\__\//__\_/__\\\_/__\//__\//_\_/\/\_\/_\/\__/\_/_/_\/\/_\\\/\/_\/____\_\\__\\\\\_///\\\_/\_\//__\__\__//\/_/_/__\_\\\/\__/__\/_\__/\//\/\\\///_\//\/_/\\_____//\\/\\_____/\/_/_/__\\\__/\\_\//\_\_\_/\/\///_\__/\_//_\//_/\\\___\_\_\/_/_/_\_\//\///_\\\/\_\/\/\_/\_/\\/_//_/__//\/\/_\//_//_/_/_////__/_/__//\/\//_//\/_\\\\/\\__\\_\\___/_/__\\_\/__///\/\_/\/_\//__\/_\\/\__/__/_\/\///_/_\\_\_//___/\/_\_/\//_/\_\_\_\/_///_///\\_\//_/\\\/\\_/\/_\//_\__\_\___\_\\\\\/\\//_/\_/\//_\/_\_///_\/\\/___\\_\_\___\/\/\\////_\__/__\_\\/_/__\_\\\/\////\\___\/_\\\\\_/_/_\__\__//_/_\/_\\\__\__\/_\\\_\_\\/_///_/\/\/__///\\_//__\__/____\_//\/\\\\\_/\\/__\\__/\\\\_\/_\\_/_/_//\/\\///\//_/_\///_\/_/\\//\__///\\\_\/////_\\\/_///_/\\/\/_/_/\__\\/_/\_/\\\_\/\//_/\_/\_/\\\\/\/_/\\/////_/_\\\/\\/_\/\\__\_/__//\\_/_\_//_/_\_/\/_\\_\/\//\_/_\___/__\///////_\_/___\\/_\\\\\//_\\__\\/_/_//\__\_/\///_\///\\/_/\\___/\\\\\\///\\/\_\/\_\_/\\\/\//_/\\_///_/_/\_\/\//_//__//////__/\_/___\___/\\___\\/_/\//\\\\\\/\\_/\/\\/_////_\/___\/__\__/\\___\\_//\_\__\\__//\\\/\/___/\//\/\\\\//\//___//\\\///\/_\\_/\_\\\/\/_/__\\\_\_//\__/__\\___\/_///\\\/_/\//\//___/\/\__\\__\////\__/_/_\\_/\/\_/___/\_\\//_/_//\\\_\\\/\_\/\\//\_/__\\_/_\_\\\/_/__\/_\\\\\/__//\_/\//\//\/\/\///_\__\_\/_///__//\/\/_/\//_\\/\//_///___/_\_/\\/__/\\//__\_\__//_//_/_\\//__/_\_\_/_\/_/_//__/___\\\___\______/_/\//\_/_\\\__//\/_//\\\__/\/////_//\_\\/\_/__\/\/__/\\\\\/_\//_\\\__/_\\_\\/\__\\\/_/__/_\//__///\/\_/\_/_//\\_///\_\/_//\/_\\\\\\\\__\_/\///\/_\_\\\//_/\/\\\/__///\_/___\/\\_\/\/_/\/_///___\__/\/___/\///\///_/\\\/_/\_/\\/\_/\_///_/\\\\/_/__/\/\/_//\/\_//\//__\__/__//\\\/\__/\\\_\__/__/_\//_\\_\_\_\\/_\\/\_/\_/__\
Valid:
_\_/
Generator: +-
\\\_//
Generator: -
\/\_\_
Generator: --
_\\__/\/
Generator: +--
\\_\__\/\/
Generator: ---
\\\__\____\/
Generator: +-----
__\\_/\______/\\\_\/\/_///\\_\//\_\/_\_/__/___/__\\_\_//__\\_/___\_______//\/_//__\/\\\__\/__\__/_\/
Generator: ++++++++++++++++++++++-------------------------
_/\_//\_\\//___\\//\/\/_\\_\/\\/\_/__\_//\/\__\/\//\\/\/\\\/\\\_//_\/\_\\\/__/\__/\_/_\\__/___/\__\_////\___\/\\\_//\\_\__/\_/\//\/_\/__\//\\_//\\/\/_/\\/_/\_\/\_/__//__/\//_/\_\__\_\_/\////__///__/////_\/__/\\/\_\\/////_\//_/\\\/\//\\/\_\_////\\_\/\_\//_/_/_\\__\\\\\_//\\_/__//\_/\_\/\_//__//__\_\//\_///_/////__\\/\\/\//_______//_\//_/_/__/\/\/_\/__/\///_\_/\/////\/\__///__////_/\\\_\/\___\\\//\/\_\/\////\_/\___\\_\_/_\\__\\___/_\_///\____/\\\/\_/\/\\\\/_\/\/\\\/\\__///___/___\\_///\_/\///__/_/____\\/___\___\\/\__//_\/\\//\_//\_____/____/\/\_\/_\__/\\\/__/_/_/\__/_/_\\/_///__\\\\/_\//_/__\//\_\//_\/_\\_\/__/_\_\\_\\//_//_\_/_\/\\\\/__/\/___//__/_/\/_\/\//___\/_//\/___\__/\/_\//__\\_\///\\/_\_/_\\//\\_//\\\\\_///_\_/__/\_/_/_\\_\_/\/_//_\\/__\\/\\__//__\__\\\\_/\____\___\//\_\_//_/_/__//_\_/_///__/_/__\/\///\_\/_\_/_\\//\//\//\_/\\/\/\///\/\/\\_\//\__\\//__\_\_\\_\_//_\/_/__/__\_\\\_//\\/__\_\\_/\\_/\_////\/_\_\\__\/_\//_\_\/_/__\\//__\_\\\\/__/_\_\/_\\__///\/\_\/\_/\\_\\/\/_\\\//\/\//\_\/_/_/\//\\\/\\/\\_/__/_///__\\/\_\_//_//\//___/___\_/\/\__/\/_/\\\_\\/__\//\/__\_\//\__\/\__\//__\_/_\\_/____/\/_\/__\_\\_//_\\_\\__/_\/_/\\/\\__\\/__//_\/\/\_\/_/__/\/_\_////\\/_\_/\\\_///___\_/__/\/\__/\\_//_\_\_/\/\_\_/\\\/___//__///___\/_\\/_\\\\/__\//\__\\_\\//\/\____\/__///___//\__/_\__\__\\\\\/_\\\//\/\\//__/__\\//\\/\\\__\\\_\_//__/_/\__\_\_/\/\\\_\\//___\_/\/\___/_/\/_\\_\____/\///\/\\\\_/\/_\\_\//\/\/_/_\_//__\\\_\____\/\\_//\\\\\//_/_\_/\\_\/___\/__\_\_\\\\//__\\__\_/_/_\_\\__\_/\///__\/\/__/\__\_\\\/_//\_\//__\/\\/\\/__/\/\\\/____/_\__\\_/_\\\//__//_/_\\//\/\/\_/\_/\\_\//\__/\\/\\_\_/_/\_/_/_/\\_\_//__\/\__\\/_\////____/\_/\//\\//\_/\/_/////_\_\/\/\\////\/\\_/////_\___\\\\\/___\///__//\\__//_\\/\/_//\\__\\//\\/__\\/_\/_/_\_/\__//\__\\\\_/\/\__//_\//_\\___/_/_/___\/_/_\\\\__\_____///__//_//_//\///\//_//\\_\_\_/\/__/\\/\_\/\_///__//_//_\\///_/_/_/\\_\__\\/\____\__//////__\//_/_\\/__/\////\_/\__///\\/\//__\/__/_/_//\//_/\/__/\_/_//\\/\\___/_\\_/\/\_/_\__\__\/\/_/\__\///__////\__/\__/_\\_////////__\/_/____\/_\\\\/\__\\\_\///__\/////_\//\//_\__\/\\__\\_/\/\\//__\_/_\/\//\_\/\\/\\/\\_\\///\\\__//_\\_\//\__//_\/\_///\\/\/\_\//\/____\\____/_/\/_/\/__\\\_/__\\/_/_/\/\\___////__\\/////\___\\/_\_//_\\/_/\//_/\__\/___\__\/\//\/__\_\\\_\/_\//\/\//\/\\///\///\/\_\\//\_\\/\\\____\\\/__/////_\_\///_\\\\_\__\_____\\_///\//\_//\/\_\\_\\/\__/\\/\\_//_\//\\/\_\\_/__/_\/\\/\_///\/\\/\/__/\_\/\\_/\////___\\//\\_\/\//\//\___//\/_/_/_/__\//_/\\_\_\/_/__///\_\\_\\\\_/______\/\\__\/__/_\_/__\/\\___\_/__//\_\/_/_\\_//\/\_/\__/\\\_\\///\_/\\_/_\/\\/_\/_\\\/_\\\_/_\///\\/__//_\\\__/___\\_/\\_\__\\\//\_/_///\_//\/\/\_\\/\\/__\_____//\\_/\/\/\///\_\__\______\//_\\\\/_/\\/\\//_\\_/\\__/__\\\/\\\_/_/\__\_\//____\\\\//\\_/\\/\\\_\///_//\_//\\\/\__//////_/_\//\\\\__/___///_/_///\\_/_/\_\_\//\/__\__//\//\/\/\__\__\\/_\_\//\_//\\\///\\\/_\\____\\\/__\\_/\//\/\\\/\_//_/_\\\_\///__//\_/_/\__//___//_\//\/_\//\\///\__\__//\//\/\/\___///_//_\/\\_/_/_\//__//_\_\\//\/\_//_/_\/\/__/////\_/__\//\/_/\__/\_\\\/_\_/__\\_/_/\///_/\_/\/__/_/\/\/\\//\///\/\\/__\\_\\/_/_\_/\\//\_\\_\______\\_\_\////_\_/\\__/_/\\\\//_\/\_\\_/\_\__\_\\\\///_/__/\__\_\/\____\__/_//\/_\\/_//\/_//\/_/_\_//_/_///_\\\_//\_\_/__///_/\_/___\___/\_\_/\\//_\/_\/////\\_\//_//_/___\/\\/_//\__\__/___//\___/_\\\/\\_/_/_\\//\/_\\_//_//_/\__/_/_/\_\/_\\\/__\\___\___/_//\/_///\_/__/__\__\\\__/_//\\/_/_/__\\\\_\\_\/_\_\\/_/_/\/\\__\/_/__/\//__//_\_/\\\\_\/_\_//\__/\\_///_/\\\/\\/\_/\_\/\\\//\_/_\\_\\//\//\\//___///\\\//\__\_//_//\/_/\/\/__\\\//\/____/___/\__/\\_\_///\//__/_//_\\\\_////\__\//\_/_/_/\\_/_/\\___/\\\\_\_\///\_//_\_\\\/\/\_/__\//_\\/_////_\\_/\___\/___/__/_//_\\/_\/__/\\/__///\\/\/_\\__\///\//\\\\_\\_\/_\_\//\\/\\/\\//\_\\\__/\\\__/\_\\\_/_\\_/\\__/\\/__\\/\\\/__/\//_\/__\___\//___/_//\_//_///__/_/\\\_/_/\_/\_/__///_/_\_\_/\__/\\__/\//\__\/////_/_\\\\\/__\\\___\/___//__\\/\\_\\\\/_/__\_/\/_//\/\_/\\/\_\\/\\_\\\\/\_/_/\/_//_/__/\\\_///_/\/_\\///_\/\/__\\_//\\/\__//_\\__/_\//\\_\_\__\\/\/\/__/\/_\\\\__////_\/_//\\//_/\\/\__/_\/\__/\//_/\__//_\_\//\_//____\\\\_\/\/___\/\/\/___/__\///\/_\___//\_/\__\\_/___///\//_/__/___//_\/__\\\_\/_\\//\__/\____/_/\\/__\///_/\__\\/_/_/___\/_\__\/_\\/\/\_/\_\/\__\\\//\\\/\_\____/\/_\_/\\/__\\///_\_\\//__\_/__\//\___/\_\_//_/___\_/\\\/\\_\///\/_\\/_\_/_\/_\\\_\___\_\//_//\_\_\_\/_\\/\//_\\/\\__////\\__\___\/_/\_/\___/_\_\_\__/__\//\/_\\___\/\\_/\\_\\/_\\__/__\_/\_\__/\//____\//_____\__/\//_\////\//\//\\//__/__/\\\/_//__/\\\_\//\_/\\\\/___\__//_/\\/__\_/\__\/_\//__\_/___/__/_\///\/__/\_\\__/__\/\_\/\/_/\/\_//_\_\/\__\/_\\/////__/_\_/\_/\_/_\/\\_\\\//\_\\\/\_//\//_\__//\//\\\/_\/\/\/\_/_/_/___/\\/\_\\/\\_/\__\/\//////\_/\////\\__/__\\\_//\_///_//\/\_/\/_/\/__\_\__\//_/_/_\\\/\/_/\\__/\_\_\_\_//\\\//___\__/\___\_____\_/\\/__\\\\\_\/__/\\/\____/\//___/_//\/__////\\//_\/\_/\/\\\/_/__\\/\////_\/\/_\/\___/__/\___//\////\\\_\\\_/\////___/\\\\/\_/_//_/\_/\_/\\/\/_//____///___\/\_\_\\//_/\\\/\___\/_\/_/__\//__/____\/\_/_\_\/\//\\_//\///\_\_\_/\\//\_\\_/_/_\__\_\__\//\\/_\_/\_\/__\\//\\//\///\\/\_/_\_\\_///\///_/\//_/\\//\_\_//_/\/\/\\\\/\/\_\_/\//\_\///__\/\\_\___///_\_\//\_\\/\\/\_\\\/_\/__/__/\/_\\_\/\__/\\\_\_//\/_\\/\_///_\//_\\__/__\_//\\\___\__/___///\/\_\\_/\/\/\\\\/\///\_///////\_/\/\\\_//\//\_//\_//\\///_//\/\_\_\/____/\\_\___\_\\//\/\_///_\\/_//_\/_\\\_\_/_\\//\_////\_\_/\\/_//__\\//\_\/_\///\//_\_/\/\_/___\\//__//__\__/_//__/_/_\\_/_\_//\\_\\\/__///\//_/_//\\/_//__\_\\/\_\_\///__/_\/_\\_/\_\\\/\\\__//_///_/\_///__\/\/\_\_/_\/\_/\/\\\\_\\_//\_\\\///\\\/\__\___\_/\/\_\/\/_//_/_\/\\/\_\/_/_\/_/\\___\/_/_/\____//\\\_/\_/_\/\_/__\\\/\/\\\///_\\\\\\/_\__/\_////_/\/_\///\//_\/_/_/\\\___\\\_\//\_\\\_/____/___/_\_\/____\__//\__//\/_\/__\\/\_\___\\//__////__///__\\\_\_\__//_//\_/_\__\_\_/_//_/\\\\_////////__/\__\/\//\//\\\_/\_/_/\_\\///___\\_////_\_\\__/___\_/\_\\\_/_////_//////\\__\\/_\///__///__\_/_/__/_\\/\\\/\\/__/_\_\\\\/\_/___\\_\//_\_\\/\_\/_\///_\__/\_//\/___\__/\_\__\_/_/\\//\/_//_\\\//////\///_//_/_\_//_/_\\_\/\\_/_\\////_\_____\\/\/\_///_\/_/\//_\/\_\\_//\\__\\_/\/___\/__/\/\___/_\\_///\/\/_/\_/\\\_/___\__//_\__//\\/\__/\\_\/\\_/\_\_/_/_/_\\\////_/_/_//__//\\\_/\//\_/\_/\_\/\\___///__\\\__\\_//_/\__/_\_\\/\_/_/\\\///\\//\____\/\_\/\/_\///_\\//___/___\\_\\//\_\\/_\///___\\//\/\\_/\_\\//\\/\_\_/\\\__/_\_\_/\\\\_\\///_//////___\/\\/\/_\\/\\/\/\\\_\\_//\\_\__/__//\/\//\_/\/_//\/\/\/_//___\_\____\/_/\\/__/__/__\\\_\____\_\/_____\_/_/\\_\\__/\___/\_\////_/_\/\__\////_\\//_///_//\____/\_____\\\//\__//\\\/__//_/\\\__/_//_\/___///_\___///_/__//\_/_\/____\_//_\///_//\\/_\//\___\//\\_\/\_/__\_//\/_/_////\\/_///__/\/\__/_\/\/\//\_//_/_///////_//_\_/_\//\_/\\\_\_\/\\\//\\/__/_\/_/\_\\_/_/_\\////\/\_///\_/\/\\\___\\_\/\\\/_\//\/___/\/\_\_\__\_/\\/____/\/___\/_\_\\_\_/\\\\\\/_\/\\/__\\_//\\\//\\__\_\__/_\_\\\_\__\_/_//\_//__//\//___\/__/_____/\\\_/__/\/\/_//\__\///_\/\_\\\//_//_//\/\_\_/\\\__\/\__//\__\\_/__//_//_/_\\__/__\//\_\/\__/\\\_//\_//_/__\///_///\//\\__///\__\/\//__//\_\\//\_\_\_/\///__\\\\//_/\_\\_//\///\___/___/\/___\\_\\/__/\\\///\_//___/_//\\_\\_/_\//\_//_\___/____\/__/__/_\__\/\/_/\///_///___\_//\_\\\/\\//____//_//\\\/_/\/_\/_\\\/\\\__//\_\\/\\//\/_/\\_/__/\_\\//_/\\\__\/\//\\//\_/__\/__/\_\_/\\_\_//\//_/_\\_/_/___/_\_\\\\\_\_\///_\_/_/\__/_\/\_\_\_/_/_//_/_\_\/_\/_\_//\_//_\//\_\/\_/__/___\\\/\\/_/__\_///_/_///\\\/_///_/\_____\__//\\\_/_\\__/\\\__//_\/_\/_\/__\_\//_\___\/\/\\\__\//_/\\//_//_///\_\\\_///__\\/__\\_/_\/\\\\_/\\\/\\/\_\//_/\/_\/_\/////\\\\//__\_/___\/\_//_\/\_//_\///\\\\_\_\_\_\__\_/__/\/__\\//_\/\_/\_\/\__/\_////\/\/\_/\__/\\//\/_/_/\_/__\_/\/\/\_/_/\_/\\\\_\/////___/_\//_/\/_/\______\_\/___/\\\/\/\/_____/__\_//_\\\\_\//_//_\_\\\_/\/\__//\_/\__/////\__/_/_\/\/\\/_/\_\_\\\/\/\\\\/____\/\\\/__\___/_\\//_///_/_/_\/\\\\\_/\_/\\_/\/\\/___/\___\_\/_\/__\/\///_/_\\_//\_///_\_//__/__\\\\_\__\__//\\/_\//\\\//__\/\____/_\//_/_\\/\\\\\_/\_\//\__/\\_/_\/\\_//\\__/__/___/\/\/___/\\/\/\_/\_\\\_//\_\/__\/\//___/_\/____/\_\_/\\/\/\/\__\_//_/_\//\__\\\//\\/\_\/_\////_////\_/_/__\\\\_\//_\\___\_/\///_/_\\\//\__\\_\_/\/_/_\///_/__\//__\/\\___/\\\\_//_\/_\\\\\_\/_\\//\_\\//___//\\_\_/\/_/\/\/\/__\\\\__/\/_//_////\_//_\___/\/\///\/__//_\\_//_///\\_\/_\\\/\/\\\/_/\_\///___/\\\\\/__\/_\/\__\____//\_\_/_\_\\_/__\\\/\_/\////__\_\/_/_/\__\_\__\/\\\/\\//__\\__\/\/\\__\\\_/\\_\/\___/__\\/\\___\////\\_____\\_/\/_\\//___//_\\\//\_\/_\/\______//__/_\_//__/__//___/\/_\_//\//_/_\//_/\//__\/__///\_\\___/_///\_/\///__/_//\/\_//////_/\\_\\_\/\//\\___\\_///\_\_\/__\_/\/\_/__\___\\/__/\_/\_\__\//\\_\\\/_/__\/_///\//____/_\___\///_//\///_/_/\/\\/\_____\__\\//////\\///__\_//\/_//\/\\////_/_____\\_/\///\\__\/\\_//\//_\//__\/_\____\___/__\/\/___/__\_\\__/\/\__\_\__///_\//\_/__///\/\_/\_/\///_/_/_\___/___/_\_/\_/\//\/\\/_//_\__/\\\_/_/__/\///\//\_\/\\/\_\\/\//_\/\\_/\\\\/\_//__/\/_\/\/_//\\//\//_\_\/\/_/_\//\//\__////\\_\\\_///////_/\/____\\\\/_\\/___/\\\//\\/_//__\//_/__\__\___\/\_/\/\//\__/_\__\_\\//\\_\__//\_/\_\\__\/_\\_\/_\/_/__/___\\//_\_\//_\//\\/\/_//\/\\/__\\\/\///_\_\\_////_/\\__/_\\__/__/_\////\//\___/\\/_\__\_\/_\_\\////_////\/_\_//\_\_\/\_/_/_//\_/\/__\/__\/_//_//\\\\__\//\_/\_\\\\//\\\\_\\\____\\/\_\_/\////\_///\___/___\\\\_\\\//\\\\\\/\_\_\_\/_/_//\\/\___\_____\___\/__\/\\__/\/_\\/__\_/\_\__/_/_/_\/\\____\__/\/_/___\/\____\//_\////\_/__/\_\//\//\_/_//\\/\__\_////_\/_/_\/\/__\__\\///\\\\_\\_\/__\\///_/__/_\\/\\\/\\/\_\_/_\\////\_/\_\/\//_/\/_/\\\\///\_/\\__/_\/\/_\/\_//_//\__\___/\_\/___\/___/_/__\//\_\_\__\\/\/_\_//_\_\\_/___//\//\/\\/\_\/\/_/\_\/__\_\/_\__\/\_\///_/_\\\\/\____/\/\_/_\_//\/\/\//_//\\_\\/_\/\_\\__////\_/__/\/\////_//___\/_\\/_/_\_//\_/\\___\///_\/\\_///__/_\/___////_\__\_\__\\/__\___/_/\\\\\\//\\\/\_\/___//_\\_//_/_/\/\_//_/\\\/_/_\_\/\__/\_/_\/\/\_/_/\/__/\_/\\/_\_/\_/\//___\_____/\/_/\/\_\/\_____\\/___/\\__//\_____\\/\_\//\//__\/_\___\\/\_/_/\/\///\__//__\__/\\__/_\_\/_/_//__\////__\_/_\/_\___/_\/\__/_\\_\\//\/\\/___\___/_/\\\\//\___\\\_/_\_\_/_/\_/\/\___\//__\\\\_/_\////\_/_\/__\\/////_\_\_////_\\///__/\/_\__/\___\//_/_/__//_/\\//_//__\/\__/_\///_/__//\_
Generator: ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
The generator output is just an example. It needn't be "ordered" as the one seen above (although I assume this to be more practical to implement).
That last test case may or may not be 10000 chars long and my computer may or may not be trying to find a valid parcours of length 500000 at the moment.
+-
for incorrect cases? Also, can we assume an _ exists? \$\endgroup\$+-
for incorrect cases: As long as your falsy output is distinguishable from the truthy output/acceleration string, yes. Assuming at least one flat piece: No. \$\endgroup\$/_/\
was truthy in my program with output+
, because-1 + 1 + -1 + 1 = 0
, but the leading-1
would make the speed go from 0 to -1 m/s, which isn't possible (and which I assume is the reason it's falsey)? Or am I missing something, and/_/\
is falsey for another reason? \$\endgroup\$