Change separator to be a newline instead of space
This commit is contained in:
parent
1717a2492c
commit
b34f91c933
|
@ -16,9 +16,9 @@ impl Program {
|
||||||
fn from_string(program: String) -> Program {
|
fn from_string(program: String) -> Program {
|
||||||
let mut op_list: Vec<String> = Vec::new();
|
let mut op_list: Vec<String> = Vec::new();
|
||||||
|
|
||||||
for opcode in program.split(" ").collect::<Vec<&str>>() {
|
for opcode in program.split("\n").collect::<Vec<&str>>() {
|
||||||
let mut new_op = opcode.to_owned();
|
let new_op = opcode.to_owned();
|
||||||
new_op = new_op.replace("\n", "");
|
// new_op = new_op.replace("\n", "");
|
||||||
|
|
||||||
if new_op.len() != 0 {
|
if new_op.len() != 0 {
|
||||||
op_list.push(new_op.to_owned());
|
op_list.push(new_op.to_owned());
|
||||||
|
|
Loading…
Reference in New Issue