-
Notifications
You must be signed in to change notification settings - Fork 0
Add a fast variant of the brainfunct protect function #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice i don't understand at lot that's going on, especially the pong list of one character variables 🙃 but this is pretty sweet
let output_string = output.value(); | ||
let mut temp = BrainfunctProgram { | ||
operations: Vec::with_capacity(p_string.len()), | ||
functions: vec![usize::MAX], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
heh?
func_index += 1; | ||
c | ||
} | ||
_ => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't brainfuck actually permissive in characters allowed? i suppose that's different for brainfunct 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know that it's actually different. It's just the rules I'm implementing for this interpreter. i could always just have it do nothing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to decide whether to ignore illegal characters or error.
loop { | ||
if current_index >= op_size { | ||
if stack_head != -1 { | ||
// panic!("Your call stack wasn't completely emptied even though you have reached the end of the main function"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Get rid of vestigial comments
} | ||
b'@' => { | ||
if tape[tape_ptr] >= func_size { | ||
// panic!("Undefined function {}", tape[tape_ptr]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Get rid of vestigial comments
func_index += 1; | ||
c | ||
} | ||
_ => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to decide whether to ignore illegal characters or error.
No description provided.