Change separator to be a newline instead of space

This commit is contained in:
~karx 2021-02-07 17:30:10 +00:00
parent 1717a2492c
commit b34f91c933
1 changed files with 3 additions and 3 deletions

View File

@ -16,9 +16,9 @@ impl Program {
fn from_string(program: String) -> Program {
let mut op_list: Vec<String> = Vec::new();
for opcode in program.split(" ").collect::<Vec<&str>>() {
let mut new_op = opcode.to_owned();
new_op = new_op.replace("\n", "");
for opcode in program.split("\n").collect::<Vec<&str>>() {
let new_op = opcode.to_owned();
// new_op = new_op.replace("\n", "");
if new_op.len() != 0 {
op_list.push(new_op.to_owned());