# AoC 2017 Day 25: Turing

### Source: The Halting Problem

Part 1: Implement a Turing machine defined as such:

Begin in state A. Perform a diagnostic checksum after 6 steps.

In state A: If the current value is 0: - Write the value 1. - Move one slot to the right. - Continue with state B. If the current value is 1: - Write the value 0. - Move one slot to the left. - Continue with state B.

# What the (be)funge‽

Here’s a fun little bit of code for you:

55*4*v    _   v
v   <>:1-:^
|:<$< ,*48 < @>0"zzif">:#,_$      v
>:3%!|    >0"zzub">:#,_$^ >:5%!| v "buzz"0<>:. ^ |!%5: < >:#,_$>              ^


Gibberish you say? No! Befuge!

# Parallel BF

Getting a bit close to the deadline, but I think I have something that’s pretty interesting. Basically, it’s the same BF interpreter that I wrote about yesterday with four additional commands:

& Spawn a new thread; set the current cell to 0 in the parent and 1 in the child
! Send a ping on the channel specified by the current cell
? Wait for a ping on the channel specified by the current cell