Skip to content

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ProfDoof
Copy link
Owner

No description provided.

Copy link

@jasikpark jasikpark left a 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],

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
}
_ => {

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 🤔

Copy link
Owner Author

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.

Copy link
Owner Author

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");
Copy link
Owner Author

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])
Copy link
Owner Author

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
}
_ => {
Copy link
Owner Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants