reverse the Instructions vector, so he can behave as a queue

This commit is contained in:
Martin HART 2020-10-31 17:40:53 +01:00
parent c7f0a0a281
commit f2bfdeb28e

View File

@ -172,7 +172,7 @@ fn parse_config(conf: String, pool: &mut Vec<robot::Robot>) -> Result<world::Wor
};
// Convert instructions line.
let inst: Vec<char> = raw_inst.chars().collect();
let inst: Vec<char> = raw_inst.chars().rev().collect();
if !robot::is_instructions(&inst) {
return Err(String::from("Invalid instructions !"));
}