6
1
Your task is to write a program that, given a number n, returns a list of all valid, halting Smallfuck programs of length n, in any order.
Actually, we're using a variation of Smallfuck called F2, which is just Smallfuck with a right-unbounded tape. For the purposes of this challenge, a program that moves left from the start of the tape is considered invalid, as is one with unbalanced brackets.
Scoring
Since solving this for every n is impossible (as it would require you to solve the halting problem), your submission's score will be the lowest n for which it returns an incorrect answer.
Each submission must be, at most, 1000 bytes (though you are encouraged to provide an ungolfed version as well). In the event of a tie, the earlier answer wins.
Test Cases
n = 1:
+ >
n = 2:
++ +> >+ >< >> []
n = 3:
+++ ++> +>+ +>< +>> >++ >+< >+> ><+ ><> >>+ >>< >>> >[] [+] [<] [>] []+ []>
n = 4:
++++ +++> ++>+ ++>< ++>> +>++ +>+< +>+> +><+ +><> +>>+ +>>< +>>> >+++ >++< >++> >+<+ >+<> >+>+ >+>< >+>> ><++ ><+> ><>+ ><>< ><>> >>++ >>+< >>+> >><+ >><< >><> >>>+ >>>< >>>> [][] ++[] +>[] ><[] >>[] [++] [+<] [+>] [<+] [<<] [<>] [>+] [><] [>>] []++ []+> []>+ []>< []>> +[+] +[>] >[+] >[<] >[>] >[]+ >[]< >[]> [+]+ [+]> [<]+ [<]> [>]+ [>]> [[]]
Please inform me if there are any more that I have forgotten to add.
Comments are not for extended discussion; this conversation has been moved to chat.
– Dennis – 2017-06-08T14:10:40.900For n=3 assuming 2-way unbounded tape, we get <[] as well. – user75200 – 2018-01-13T18:03:43.493
@user75200 "For the purposes of this challenge, a program that moves left from the start of the tape is considered invalid." – Esolanging Fruit – 2018-01-15T00:42:28.960
This challenge is effectively just "write a Smallfuck implementation and find all programs that halt after at least G steps, where G is the largest constant you can fit under 1000 bytes." – Esolanging Fruit – 2018-06-20T07:14:27.600