Skip to content

Instantly share code, notes, and snippets.

@hiromu
Created January 12, 2011 14:39
Show Gist options
  • Save hiromu/776224 to your computer and use it in GitHub Desktop.
Save hiromu/776224 to your computer and use it in GitHub Desktop.
#include <cstring>
#include <iostream>
#include <unistd.h>
#include <sys/syscall.h>
using namespace std;
#define __NR_brainfuck 223
#define OUTPUT_LEN 100
int main (void)
{
int source_len, input_len;
string source, input;
char output[OUTPUT_LEN];
cout << "Source :";
cin >> source;
cout << "Input :";
cin >> input;
syscall(__NR_brainfuck, source.c_str(), input.c_str(), output, source.size(), input.size(), OUTPUT_LEN);
cout << output << endl;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment