{"id":116,"date":"2013-12-29T16:13:53","date_gmt":"2013-12-29T16:13:53","guid":{"rendered":"http:\/\/enginmercan.com\/?p=116"},"modified":"2013-12-29T16:14:06","modified_gmt":"2013-12-29T16:14:06","slug":"brainfuck-tutorial-part-3-a","status":"publish","type":"post","link":"https:\/\/enginmercan.com\/?p=116","title":{"rendered":"Brainfuck Tutorial &#8211; part 3 (for expertes only!)"},"content":{"rendered":"<p>Ok, now let&#8217;s move into even more advanced stuff.<\/p>\n<p>In this tutorial I will talk about conditions and booleans.<\/p>\n<p>For making conditional statements, we need []. Let&#8217;s say you want to run a code only if a cell is &#8216;true&#8217; (non zero). This one is the easiest!<\/p>\n<p><code>[ [-] your code ]<\/code><\/p>\n<p>&#8220;your code&#8221; only runs if the initial cell is non zero. After entering the first loop it clears the cell so it won&#8217;t repeat &#8216;your code&#8217; again and again.<\/p>\n<p>Let&#8217;s say you want to run a code if a cell is not true. Our structure is like this<\/p>\n<p><code>..ab..<br \/>\n..^<\/code><\/p>\n<p>And here is the code. I put some comments (numbers) into code so hopefully it will be easier to understand.<\/p>\n<p><code> 1>+< 2[[-]>-<] >[ -  your code ]<<\/code><\/p>\n<p>We need a temporary cell for this stuff. In this example a is the test value and 'your code' will only run if it is 0. b is the temporary cell.<\/p>\n<p>First (1) it sets b to 1.  After that (2) it returns to a and sets be to zero again if a is non zero. In next step (3) it goes back to b and run your code only if b is non zero.<\/p>\n<p>Basically we are holding !a in another cell. If a is zero, b remains 1 and code will be executed. If a is non-zero, b will be cleared so 'your code' won't run.<\/p>\n<p>After those simple booleans, on next tutorial, I will talk about == and !=. It is actually quite easy, see ya!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ok, now let&#8217;s move into even more advanced stuff. In this tutorial I will talk about conditions and booleans. For making conditional statements, we need []. Let&#8217;s say you want to run a code only if a cell is &#8216;true&#8217; (non zero). This one is the easiest! [ [-] your code ] &#8220;your code&#8221; only [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,3,8],"tags":[],"class_list":["post-116","post","type-post","status-publish","format-standard","hentry","category-bf","category-ff","category-t"],"_links":{"self":[{"href":"https:\/\/enginmercan.com\/index.php?rest_route=\/wp\/v2\/posts\/116","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/enginmercan.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/enginmercan.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/enginmercan.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/enginmercan.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=116"}],"version-history":[{"count":4,"href":"https:\/\/enginmercan.com\/index.php?rest_route=\/wp\/v2\/posts\/116\/revisions"}],"predecessor-version":[{"id":241,"href":"https:\/\/enginmercan.com\/index.php?rest_route=\/wp\/v2\/posts\/116\/revisions\/241"}],"wp:attachment":[{"href":"https:\/\/enginmercan.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=116"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/enginmercan.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=116"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/enginmercan.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=116"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}