Created
June 15, 2009 16:48
-
-
Save avescodes/130209 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def process_nethack_log(log) | |
data = log.scan(/#{"(.*) "*15}(.*),(.*)/)[0] | |
fields = %W| version score dun_number dun_level max_level hp max_hp deaths end start uid role race gender alignment name ending| | |
results = {} | |
(0..16).each do |i| | |
results[fields[i]] = data[i] | |
end | |
results | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment