Quote:You will receive a line with string particles, separated by "|", representing parts of the name of a weapon. The particles will be in mixed order and you can align them through the commands, which you will receive on the next lines, until you receive the "Done" command. They will come the form of strings, separated by space. There are five supported commands: • "Move Left {index}": • Moves the value at {index} position to the Left, if the index exist and the move is possible. • If movement is not possible, do nothing. • "Move Right {index}": • Moves the value at {index} position to the Right, if the index exists and the move is possible. • If movement is not possible, do nothing. • "Check Even": • Print the elements at even index positions, separated by a single space. • "Check Odd": • Print the elements at odd index positions, separated by a single space. After the "Done" command, the weapon name is considered correct and you should print the particles in their current order joined together in the following format: "You crafted {WeaponName}!" Input • On the first line, you will receive parts of the given weapon name in a mixed order separated by "|". • On the next lines, until the "Done" command, you will receive commands in the format described above. Output • Print the needed output upon the "Done" command as a string. • Output should be in the format "You crafted {Weapon name}!"
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)