From 4ca4a1389d006b39d4791989fd681cd87640b487 Mon Sep 17 00:00:00 2001 From: id101010 Date: Mon, 14 Nov 2016 23:58:00 +0100 Subject: [PATCH] Working memory viewer --- bfckr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bfckr.c b/bfckr.c index b20fddf..f4ea3ba 100644 --- a/bfckr.c +++ b/bfckr.c @@ -107,7 +107,7 @@ void print_memoryviewer(bf_code_t *bf) // print the adresses beneath the memory cells for(int i=(mp-7); i<(mp+8); i++) { - printf("%03d ", ((i<0 || i>MEMORY_SIZE) ? 0 : abs(i-mp))); + printf("%03d ", ((i<0 || i>MEMORY_SIZE) ? 0 : (mp+i))); }