In this challenge, you need to parse morgue files from the roguelike game Dungeon Crawl Stone Soup and output it to STDOUT.
What are these morgue files??
When you die, a text file is generated with that character's data inside. You can see what equipment the character had, what happened during the last few turns, and how many monsters he has killed.
You can find a example morgue file here
Your job is to make a program that takes one of those files from STDIN, parses it, and outputs the data to STDOUT.
To make this challenge a bit easier, you only have to parse the first block of text. (up until
The game lasted <time> (<turns> turns).
You need to parse and output the following information:
- The version number.
- The score.
- The character name, title, race and class.
- The character level.
- The cause of death/victory.
- The amount of turns the run lasted.
Dungeon Crawl Stone Soup version <version number> character file. <score> <name> the <title> (level <level>, 224/224 HPs) Began as a <race> <class> on Mar 16, 2015. Was the Champion of the Shining One. <cause of death/victory> The game lasted 16:11:01 (<turns> turns).
Test case 1 - Victory
Example output - Victory:
Version: 0.16.0-8-gd9ae3a8 (webtiles) Score: 16059087 Name: Ryuzilla the Conqueror Character: Gargoyle Berserker Level: 27 Cause of Death/Victory: Escaped with the Orb and 15 runes on Mar 17 2015! Turns: 97605
Test case 2 - Death
Example output - Death:
Version: 0.16-a0-3667-g690a316 (webtiles) Score: 462 Name: 8Escape the Ruffian Character: Bearkin Transmuter Level: 6 Cause of Death/Victory: Slain by an orc wielding a +0 trident (3 damage) on level 4 of the Dungeon. Turns: 3698
- This is code-golf so the shortest code wins.
- In the event of a tie, the oldest answer wins.
- No standard loopholes.
- File input must be taken from STDIN
- Output must be sent to STDOUT
- The labels before the output (ex.
Turns:) are optional.