Skip to content

Instantly share code, notes, and snippets.

View taiypeo's full-sized avatar

Ivan Lysenko taiypeo

View GitHub Profile
@taiypeo
taiypeo / pi.c
Last active December 19, 2016 00:17
#include <stdio.h>
#include <stdlib.h>
#include <gmp.h>
char* calculatePi(unsigned long digits);
int main()
{
const unsigned long piDigits = 500;
char* pi = calculatePi(piDigits);
@taiypeo
taiypeo / BrainfuckInterpreter.c
Last active August 29, 2015 14:27
A Brainfuck interpreter written in C
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
#define STACK_MAX 100
#define TAPE_MAX 30000
#define ECHO_MESSAGES 1
enum MESSAGE
@taiypeo
taiypeo / BrainfuckInterpreter.cpp
Created August 21, 2015 19:26
Simple Brainfuck interpreter written in C++
#include <iostream>
#include <stack>
int main()
{
std::string program;
unsigned char tape[30000] = {0};
unsigned char* ptr = tape;