- https://www.codewars.com/kata/587c0138110b20624e000253 Esolang: MiniBitMove.
Started at 23:49 19.10.2020 Monday Oct.
Finished at 02:40 20.10.2020 Tuesday Oct. (2hrs 51minutes)
<?php | |
# https://www.codewars.com/kata/587c0138110b20624e000253 Esolang: MiniBitMove. | |
function interpreter(string $tape, string $array): string { | |
$array = str_split($array); | |
$pointer = 0; | |
while ($pointer < count($array)){ | |
for($i = 0; $i<strlen($tape) && $pointer < count($array); $i+=1){ | |
$x = $tape[$i]; | |
if('0' == $x) $pointer += 1; | |
if('1' == $x) $array[$pointer] = '1' == $array[$pointer] ? '0' : '1'; | |
} | |
} | |
return implode($array ); | |
} |
Started at 23:49 19.10.2020 Monday Oct.
Finished at 02:40 20.10.2020 Tuesday Oct. (2hrs 51minutes)