Skip to content

Commit

Permalink
Improve README example (#54)
Browse files Browse the repository at this point in the history
This change fixes an error in API example and creates more interesting output.
  • Loading branch information
rien333 authored and fabianishere committed Aug 29, 2017
1 parent b6d7967 commit d723396
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@ We also provide a C api:

``` c
#include <stdio.h>
#include <stdlib.h>
#include <brainfuck.h>

int main() {
BrainfuckState *state = brainfuck_state();
BrainfuckExecutionContext *context = brainfuck_context(BRAINFUCK_TAPE_SIZE);
BrainfuckInstruction *instruction = brainfuck_parse_string("+++++.");
BrainfuckInstruction *instruction = brainfuck_parse_string(",+++++.");
brainfuck_add(state, instruction);
brainfuck_execute(state->root, context);
brainfuck_destroy_context(context);
Expand Down

0 comments on commit d723396

Please sign in to comment.