name changes

This commit is contained in:
~karx 2021-02-07 00:33:41 +00:00
parent 773c563f97
commit dbc9e1d38f
1 changed files with 3 additions and 3 deletions

View File

@ -49,7 +49,7 @@ impl Program {
self.vars.insert(argument_vec[0], argument_vec[1]); self.vars.insert(argument_vec[0], argument_vec[1]);
} }
fn eval(&mut self, instruction: &String) { fn parse(&mut self, instruction: &String) {
let opcode = instruction.chars().collect::<Vec<char>>()[0]; let opcode = instruction.chars().collect::<Vec<char>>()[0];
let arguments = &instruction[1..]; let arguments = &instruction[1..];
@ -69,7 +69,7 @@ impl Program {
while self.pc < self.data.len() { while self.pc < self.data.len() {
let instruction = self.data[self.pc].to_owned(); let instruction = self.data[self.pc].to_owned();
self.eval(&instruction); self.parse(&instruction);
self.pc = self.pc + 1; self.pc = self.pc + 1;
} }
@ -85,7 +85,7 @@ impl fmt::Display for Program {
fn main() { fn main() {
let args: Vec<String> = env::args().collect(); let args: Vec<String> = env::args().collect();
if args.len() == 1 { if args.len() == 1 {
panic!("You must provide an argument!"); panic!("You must provide a filename!");
} }
let filename = &args[1]; let filename = &args[1];